How to check in JAVA if W key is pressed code example Example: check key is pressed java if (evt. getKeyCode() == KeyEvent. VK_SHIFT)