I was trying to create shortcuts for zooming in and out in an image editing application I\'m creating and I noticed something strange. To bind the combination of ctrl>
For numeric keypad plus try KeyEvent.VK_ADD
:
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,
KeyEvent.CTRL_DOWN_MASK), "plus");
For plus on main keyboard (US keyboard layout) use:
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK),"plus");
For non US keyboard use VK_PLUS
. See bugs 4262044 and 6942481 for some clarifications.