I have a KeyEvent whose modifiers I want to change to include the shift key. My current approach is to create a new KeyEvent using information from the old, attempting to add the shift key to the modifiers. However, it doesn't seem to be working.
Is there a better way to do this?
event = new KeyEvent((Component) event.getSource(), KeyEvent.KEY_RELEASED, event.getWhen(), event.getModifiersEx() | KeyEvent.SHIFT_DOWN_MASK, event.getKeyCode(), KeyEvent.CHAR_UNDEFINED);