Erratic mouse cursor with flycam OSX

Hello everyone, i’m new here and this is my first question.

Has anyone been able to solve this problem:
I’m using the flyCam with setDragToRotate(true), however I also want to keep the cursor visible and use it for clicking on objects as well.

Whenever I click, the mouse cursor jumps after I release the button. It seems like quite a few OSX users have reported this over the years, but does anyone know of any solutions?

Note: disabling the flyCam and inputManager.setCursorVisible(true) works fine, however I lose setDragToRotate functionality.

Thanks

bump…

If i figure it out i’ll try to share the results. So far i’ve tried using lwjgl3, but that presents other issues on OSX. I may end up writing a RawInputListener to do a custom flyCam. Any who if anyone knows the real answer to my question any help would be appreciated.

Well, that would be one way to debug it, at least.

I don’t know why Mac specifically would cause this issue, though. It may be that writing your own finds out why.

I’ve traced the problem to org.lwjgl.input.Mouse.java in the setGrabbed method. Probably where its calling reset().
http://grepcode.com/file/repo1.maven.org/maven2/org.lwjgl.lwjgl/lwjgl/2.9.3/org/lwjgl/input/Mouse.java

To fix it for now create a class and extend the InputManager and either override:

private void onMouseButtonEventQueued(MouseButtonEvent evt) {
    int hash = MouseButtonTrigger.mouseButtonHash(evt.getButtonIndex());
    invokeActions(hash, false); // replacing invokeActions(hash, evt.isPressed());
    invokeTimedActions(hash, evt.getTime(), evt.isPressed());
}

Or you can override and remove mouse.setCursorVisible:

public void setCursorVisible(boolean visible) {
    if (mouseVisible != visible) {
        mouseVisible = visible;
        mouse.setCursorVisible(mouseVisible);
    }
}