Package org.eclipse.gef
Class KeyStroke
java.lang.Object
org.eclipse.gef.KeyStroke
Encapsulates a Keyboard gesture (press or release) from the User. A KeyStroke
is matched to a KeyEvent based the
KeyEvent.stateMask,
KeyEvent.keyCode or KeyEvent.character, and whether that
KeyEvent was dispatched as a result of a release or press by the User.-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic KeyStrokegetPressed(char character, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a press event.static KeyStrokegetPressed(char character, int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a press event.static KeyStrokegetPressed(int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a press event.static KeyStrokegetReleased(char character, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a release event.static KeyStrokegetReleased(char character, int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a release event.static KeyStrokegetReleased(int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a release event.inthashCode()
-
Method Details
-
getPressed
Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a press event.- Parameters:
character- the character to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getPressed
Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a press event.- Parameters:
keyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getPressed
Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a press event.- Parameters:
character- the character to matchkeyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getReleased
Constructs a KeyStroke that will match the givenKeyEvent.characterandKeyEvent.stateMaskduring a release event.- Parameters:
character- the character to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getReleased
Constructs a KeyStroke that will match the givenKeyEvent.keyCodeandKeyEvent.stateMaskduring a release event.- Parameters:
keyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
getReleased
Constructs a KeyStroke that will match the givenKeyEvent.character,KeyEvent.keyCode, andKeyEvent.stateMaskduring a release event.- Parameters:
character- the character to matchkeyCode- the keyCode to matchstateMask- the stateMask to match- Returns:
- a new KeyStroke
-
equals
-
hashCode
public int hashCode()
-