Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OSX: Dragging object in Unity 3D does not work due to lack of mouse deltas #3992

Closed
nbolton opened this issue Oct 13, 2014 · 5 comments
Closed
Labels

Comments

@nbolton
Copy link
Member

nbolton commented Oct 13, 2014

Imported issue:

  • Author: James McMullan
  • Date: 2014-05-23 18:22:40
  • Legacy ID: 4062

Steps to reproduce:

  1. Open Unity 3D
  2. Open an existing scene or create a new one
  3. Attempt to move a Game Object within the scene by selecting its 3D cursor and dragging it

Expected: Dragging an object in Unity 3D should move the object.

Actual: Dragging an object does nothing/

Versions and operating systems:

Any version of Synergy running on any version of Mac OSX

Solution

The issue is caused because the CPlatformSceen implementation on Mac OSX does not correctly emulate mouse dragging events. Mouse dragging events on Mac OSX require not only the new position to be set in the event but also the mouse movement delta. Adding the following code to the postMouseEvent function in COSXScreen fixes the issue:

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);

Temporary workarounds:

No work around

Similar bugs:

Additional comments:

@nbolton
Copy link
Member Author

nbolton commented Oct 13, 2014

  • Author: Simon Legrand
  • Date: 2014-08-13 21:18:44

This affects me too. Kubuntu 14.04 server OS X 10.9 client. Unity 3D and most other 3D apps cannot navigate by holding modifier key and using mouse.

@xhou-wavefin
Copy link

Reverted

@thediamondgames
Copy link

Hmm... Is the fix going to land to the mainstream? Because I see it has been reverted. I just added the lines from the solution to the source code, compiled for El capitan and now unity works just fine without any downsides I could think of.

@ghost
Copy link

ghost commented Sep 1, 2016

I would really love this to be fixed. Having a second mouse just for Unity development is annoying.

@xhou-wavefin
Copy link

Maybe problem is in capture mouse/keyboard hold button states.
I have this issue in Unity, UnrealEngine, Blender.
I can grab short video on both machines with full description for more explanation of that problem, if you want.

nlyan pushed a commit that referenced this issue Jan 25, 2017
OSXScreen was not adding mouse movement deltas to mouse events while
dragging. Some 3D applications rely on these deltas to implement
dragging. Adding the mouse deltas to the mouse event fixes dragging in
these applications. Ex: Unity3d
nlyan pushed a commit that referenced this issue Jan 25, 2017
OSXScreen was not adding mouse movement deltas to mouse events while
dragging. Some 3D applications rely on these deltas to implement
dragging. Adding the mouse deltas to the mouse event fixes dragging in
these applications. Ex: Unity3d
yupi2 pushed a commit to yupi2/synergy that referenced this issue Jan 30, 2017
OSXScreen was not adding mouse movement deltas to mouse events while
dragging. Some 3D applications rely on these deltas to implement
dragging. Adding the mouse deltas to the mouse event fixes dragging in
these applications. Ex: Unity3d
@nbolton nbolton added the legacy label Sep 11, 2017
@nbolton nbolton removed the legacy label Mar 1, 2018
@nbolton nbolton added the stale label Jun 22, 2018
@nbolton nbolton closed this as completed Jun 22, 2018
nbolton pushed a commit that referenced this issue May 3, 2019
OSXScreen was not adding mouse movement deltas to mouse events while
dragging. Some 3D applications rely on these deltas to implement
dragging. Adding the mouse deltas to the mouse event fixes dragging in
these applications. Ex: Unity3d
nbolton pushed a commit that referenced this issue May 3, 2019
OSXScreen was not adding mouse movement deltas to mouse events while
dragging. Some 3D applications rely on these deltas to implement
dragging. Adding the mouse deltas to the mouse event fixes dragging in
these applications. Ex: Unity3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants