I am working on a game and here I want the end-user to press Ctrl + W to exit the system.
Here is the code that I've used:
int key = e.getKeyCode();
if(key == KeyEvent.VK_CONTROL && key == KeyEvent.VK_W) System.exit(1);
... but it didn't seem to work
Can anyone tell me what's wrong with my code?
Thanks in advance!