Class KeyEvent<H extends EventHandler>

Type Parameters:
H - The event handler type
All Implemented Interfaces:
HasNativeEvent
Direct Known Subclasses:
KeyCodeEvent, KeyPressEvent

public abstract class KeyEvent<H extends EventHandler> extends DomEvent<H>
Base class for Key events. The native keyboard events are somewhat a mess (http://www.quirksmode.org/js/keys.html), we do some trivial normalization here, but do not attempt any complex patching, so user be warned.
  • Constructor Details

    • KeyEvent

      public KeyEvent()
  • Method Details

    • isAltKeyDown

      public boolean isAltKeyDown()
      Is the alt key down?
      Returns:
      whether the alt key is down
    • isAnyModifierKeyDown

      public boolean isAnyModifierKeyDown()
      Does this event have any modifier keys down? Specifically. is the control, meta, shift, or alt key currently pressed?
      Returns:
      whether this event have any modifier key down
    • isControlKeyDown

      public boolean isControlKeyDown()
      Is the control key down?
      Returns:
      whether the control key is down
    • isMetaKeyDown

      public boolean isMetaKeyDown()
      Is the meta key down?
      Returns:
      whether the meta key is down
    • isShiftKeyDown

      public boolean isShiftKeyDown()
      Is the shift key down?
      Returns:
      whether the shift key is down