Skip to content

Commit

Permalink
Fixed merge conflict #3992
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry (Xinyu Hou) committed Jun 30, 2015
2 parents 673fba5 + 965495d commit 57762f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lib/platform/OSXScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,23 @@ OSXScreen::postMouseEvent(CGPoint& pos) const
// Fix for sticky keys
CGEventFlags modifiers = m_keyState->getModifierStateAsOSXFlags();
CGEventSetFlags(event, modifiers);

// Set movement deltas to fix issues with certain 3D programs
SInt64 deltaX = pos.x;
deltaX -= m_xCursor;

SInt64 deltaY = pos.y;
deltaY -= m_yCursor;

CGEventSetIntegerValueField(event, kCGMouseEventDeltaX, deltaX);
CGEventSetIntegerValueField(event, kCGMouseEventDeltaY, deltaY);

double deltaFX = deltaX;
double deltaFY = deltaY;

CGEventSetDoubleValueField(event, kCGMouseEventDeltaX, deltaFX);
CGEventSetDoubleValueField(event, kCGMouseEventDeltaY, deltaFY);

CGEventPost(kCGHIDEventTap, event);

CFRelease(event);
Expand Down

0 comments on commit 57762f7

Please sign in to comment.