public class KeyCodeKeyBinding extends KeyBinding
KeyBinding
that matches by key code/modifiers pair.Modifier and Type | Field and Description |
---|---|
private KeyEvent2 |
keyEvent
The key to match.
|
Constructor and Description |
---|
KeyCodeKeyBinding(KeyEvent2 keyEvent,
CommandList commands,
boolean isDefault)
Creates a
KeyBinding that matches by key code/modifiers pair. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getBindingDescription()
Return the binding as a human-readable text.
|
KeyEvent2 |
getKeyEvent2()
Returns the key to match.
|
int |
hashCode() |
boolean |
matchesKeyChar(char keyChar)
Check whether this key binding matches a key character.
|
boolean |
matchesKeyCode(KeyEvent2 keyEvent)
Checks whether this key binding matches a key code/modifiers pair.
|
getCommands, getCommandString, isDefault
@NotNull private final KeyEvent2 keyEvent
public KeyCodeKeyBinding(@NotNull KeyEvent2 keyEvent, @NotNull CommandList commands, boolean isDefault)
KeyBinding
that matches by key code/modifiers pair.keyEvent
- the key to matchcommands
- the commands to associate with this bindingisDefault
- whether the key binding is a "default" binding which
should not be savedpublic boolean equals(@Nullable java.lang.Object obj)
equals
in class KeyBinding
@NotNull public java.lang.String getBindingDescription()
getBindingDescription
in class KeyBinding
@NotNull public KeyEvent2 getKeyEvent2()
public int hashCode()
hashCode
in class KeyBinding
public boolean matchesKeyChar(char keyChar)
matchesKeyChar
in class KeyBinding
keyChar
- the key character to checkpublic boolean matchesKeyCode(@NotNull KeyEvent2 keyEvent)
matchesKeyCode
in class KeyBinding
keyEvent
- the key to check