Something odd is happening here, and I’d appreciate any help anyone can offer.
I’m trying to lock the mouse cursor to a single position while the shift key is help down. Basically when drawing contours, I want a quick way for my users to be able to temporarily let go of the mouse, either to move it, rest their arm, or whatever.
currently what I’m doing is overriding modifierKeysChanged to call Desktop::getMousePosition()
and in my mouseMove, and mouseDrag, overrides, I’m simply checking for the shift key, and if is down, calling Desktop::setMousePosition() with the x and y I got in modifierKeysChanged.
When I test this, I can see the cursor fighting back a little, as movement is extremely juddery, but I can still move the pointer around the screen.
Calling Desktop::getMousePosition() straight after calling setMousePosition shows that the values for x and y match the seed values. On screen the cursor is clearly moving though.
So, is there a better way of doing this?