Updates will be applied - 3:30pm EDT (UTC -400). No downtime expected.

Commit 5e9e172e authored by Clinton Stimpson's avatar Clinton Stimpson

ENH: Provide double click support for X11 and Carbon.

      Addresses 1681 in the bug tracker.
parent a4ed57c8
......@@ -28,7 +28,7 @@
#import <Carbon/Carbon.h>
vtkCxxRevisionMacro(vtkCarbonRenderWindowInteractor, "1.11");
vtkCxxRevisionMacro(vtkCarbonRenderWindowInteractor, "1.12");
vtkStandardNewMacro(vtkCarbonRenderWindowInteractor);
void (*vtkCarbonRenderWindowInteractor::ClassExitMethod)(void *)
......@@ -94,8 +94,12 @@ static pascal OSStatus myWinEvtHndlr(EventHandlerCallRef nextHandler,
GetEventParameter(event,kEventParamMouseButton,typeMouseButton,NULL,
sizeof(buttonNumber),NULL,&buttonNumber);
UInt32 repeat;
GetEventParameter(event, kEventParamClickCount, typeUInt32, NULL, sizeof(UInt32), NULL, &repeat);
repeat--;
me->SetEventInformationFlipY(mouseLoc.h,mouseLoc.v,
controlDown,shiftDown);
controlDown,shiftDown,0,repeat);
switch (buttonNumber)
{
case 1:
......
......@@ -27,7 +27,7 @@
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
vtkCxxRevisionMacro(vtkXRenderWindowInteractor, "1.118");
vtkCxxRevisionMacro(vtkXRenderWindowInteractor, "1.119");
vtkStandardNewMacro(vtkXRenderWindowInteractor);
// Initialize static members:
......@@ -514,10 +514,27 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
xp = (reinterpret_cast<XButtonEvent*>(event))->x;
yp = (reinterpret_cast<XButtonEvent*>(event))->y;
// check for double click
static int MousePressTime = 0;
int repeat = 0;
// 400 ms threshold by default is probably good to start
if((reinterpret_cast<XButtonEvent*>(event)->time - MousePressTime) < 400)
{
MousePressTime -= 2000; // no double click next time
repeat = 1;
}
else
{
MousePressTime = reinterpret_cast<XButtonEvent*>(event)->time;
}
me->SetEventInformationFlipY(xp,
yp,
ctrl,
shift);
shift,
0,
repeat);
switch ((reinterpret_cast<XButtonEvent *>(event))->button)
{
case Button1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment