Class KeyStroke
java.lang.Object
com.levigo.jadice.web.client.util.action.KeyStroke
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 RegisteredAction
s, and thus providing keyboard shortcuts to
facilitate execution of those actions.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionKeyStroke
(Key key, KeyStroke.Modifier... modifiers) Creates a KeyStroke with the givenKey
andKeyStroke.Modifier
s. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getKey()
static KeyStroke
getKeyStroke
(com.google.gwt.event.dom.client.KeyDownEvent keyDownEvent) Finds the KeyStroke for the given KeyDownEvent.int
hashCode()
boolean
isAlt()
boolean
isCtrl()
boolean
isShift()
boolean
match
(com.google.gwt.event.dom.client.KeyDownEvent event) toString()
-
Constructor Details
-
KeyStroke
Creates a KeyStroke with the givenKey
andKeyStroke.Modifier
s.- Parameters:
key
- the keymodifiers
- the modifiers
-
-
Method Details
-
getKeyStroke
Finds the KeyStroke for the given KeyDownEvent. If the event belongs to an unknown key (i.e. if the key is not defined in theKeys
, 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
-
isAlt
public boolean isAlt() -
isCtrl
public boolean isCtrl() -
isShift
public boolean isShift() -
hashCode
public int hashCode() -
equals
-
toString
-