I am building a full screen java swing application for Mac users. This application is to be used for giving online tests and therefore requires the user not to exit from it. I am trying to block the Command + H key combination which hides the application. How do I block this key combination from my application. Thanks in advance.
Asked
Active
Viewed 83 times
1
-
The easier way might be to use a focuslistener and/or a windowstatelistener to capture if the user did hide/ leave the app if so, give them a 0! – ControlAltDel Jun 20 '17 at 09:17
-
I finally resolved it. used input man and KeyStrokes to detect the keys pressed and handled the KeyReleases through Key Listener. The solution is to detect the above and fire this.setVisible(true); This makes the frame visible again as soon as it hides. – Maneesh Raina Jun 22 '17 at 06:00
-
Great! You should post your solution as the answer and check it – ControlAltDel Jun 22 '17 at 14:09