2

For example Minecraft while playing the cursor is locked/hidden in the middle of the screen but the application can still take in the mouse movements.

Here is how it looks in minecraft

How to accomplish this in java app?

Do i need to use openGL or lwjGl or can this be done with 'Vanilla Java'

Thank you!!

Donat
  • 4,157
  • 3
  • 11
  • 26
  • This may relate to your question: [Java - Freeze Mouse](https://stackoverflow.com/questions/23724973/java-freeze-mouse) – Eskandar Abedini Jun 04 '22 at 11:43
  • You could simply hide the mouse cursor and draw a center cross to get a similar effect. However that would still allow the user to move the mouse outside of the window - unless it is maximized to the desktop. – Queeg Jun 04 '22 at 21:31
  • @EskandarAbedini Thank you that is a good solution... i will try that out! – Aditya Jain Jun 05 '22 at 10:45

0 Answers0