DestinationSol
DestinationSol copied to clipboard
Research mouse-locking options on Linux
Follow-up to #360 which upgraded DS to use LWJGL3 on the backend. As noted by @BenjaminAmos in that PR "Mouse locking has been disabled on Linux, as it does not appear to work anymore (the mouse co-ordinates returned are incorrect when the cursor is locked, so the mouse cursor is never visible when locked)."
See SolInputManager.java
for the related code. Probably this is a subject that can be researched decently online for an available alternative. Alternatively if we don't need it / can find a whole other approach then suggestions are welcomed!
May also want to look through older closed issues or PRs that may have touched the area in the past.
First interesting idea on SO I found uses java.awt for this:
- you can query the actual mouse position with https://docs.oracle.com/javase/8/docs/api/java/awt/PointerInfo.html#getLocation--
- you can reset the mouse to the center with https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html#mouseMove(int,%20int) I'll try it out when I have some time