Class KeyStroke

java.lang.Object
com.levigo.jadice.web.client.util.action.KeyStroke

public class KeyStroke extends Object
A KeyStroke represents a key action on the keyboard, or equivalent input device.

KeyStrokes can specify modifiers (alt, shift, control or a combination thereof) which must be present during the action for an exact match.

KeyStrokes can be bound to RegisteredActions, and thus providing keyboard shortcuts to facilitate execution of those actions.

  • Constructor Details

  • Method Details

    • getKeyStroke

      public static KeyStroke getKeyStroke(com.google.gwt.event.dom.client.KeyDownEvent keyDownEvent)
      Finds the KeyStroke for the given KeyDownEvent. If the event belongs to an unknown key (i.e. if the key is not defined in the Keys, null will be returned.
      Parameters:
      keyDownEvent - the key event propagated by the browser
      Returns:
      the KeyStroke for the event; null if the given key is unknown
    • match

      public boolean match(com.google.gwt.event.dom.client.KeyDownEvent event)
    • getKey

      public Key getKey()
    • isAlt

      public boolean isAlt()
    • isCtrl

      public boolean isCtrl()
    • isShift

      public boolean isShift()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object