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 RegisteredActions, and thus providing keyboard shortcuts to
facilitate execution of those actions.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionKeyStroke(Key key, KeyStroke.Modifier... modifiers) Creates a KeyStroke with the givenKeyandKeyStroke.Modifiers. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetKey()static KeyStrokegetKeyStroke(com.google.gwt.event.dom.client.KeyDownEvent keyDownEvent) Finds the KeyStroke for the given KeyDownEvent.inthashCode()booleanisAlt()booleanisCtrl()booleanisShift()booleanmatch(com.google.gwt.event.dom.client.KeyDownEvent event) toString()
-
Constructor Details
-
KeyStroke
Creates a KeyStroke with the givenKeyandKeyStroke.Modifiers.- 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
-