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 TypeMethodDescriptionboolean
static KeyStroke
getPressed
(char character, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.character
andKeyEvent.stateMask
during a press event.static KeyStroke
getPressed
(char character, int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.character
,KeyEvent.keyCode
, andKeyEvent.stateMask
during a press event.static KeyStroke
getPressed
(int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.keyCode
andKeyEvent.stateMask
during a press event.static KeyStroke
getReleased
(char character, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.character
andKeyEvent.stateMask
during a release event.static KeyStroke
getReleased
(char character, int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.character
,KeyEvent.keyCode
, andKeyEvent.stateMask
during a release event.static KeyStroke
getReleased
(int keyCode, int stateMask) Constructs a KeyStroke that will match the givenKeyEvent.keyCode
andKeyEvent.stateMask
during a release event.int
hashCode()
-
Method Details
-
getPressed
Constructs a KeyStroke that will match the givenKeyEvent.character
andKeyEvent.stateMask
during 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.keyCode
andKeyEvent.stateMask
during 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.stateMask
during 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.character
andKeyEvent.stateMask
during 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.keyCode
andKeyEvent.stateMask
during 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.stateMask
during 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()
-