public class KeyBindingState
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CommandList |
commands
The commands to bind, or
null to unbind. |
private KeyBindings |
keyBindings
The
KeyBindings to modify. |
private KeyBindings |
keyBindings2
The
KeyBindings to modify. |
private KeyEvent2 |
keyEvent
The key event.
|
private int |
state
The dialog state: 0=waiting for initial key press, 1=waiting for key
release.
|
private int |
type
The type of key binding: -1=invalid, 0=key code (
keyEvent is
valid). |
Constructor and Description |
---|
KeyBindingState(KeyBindings keyBindings,
KeyBindings keyBindings2,
CommandList commands)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
keyPressed(KeyEvent2 keyEvent)
Records a binding by key code.
|
boolean |
keyReleased()
Records a key released event.
|
@Nullable private final CommandList commands
null
to unbind.@Nullable private final KeyBindings keyBindings
KeyBindings
to modify.@Nullable private final KeyBindings keyBindings2
KeyBindings
to modify.private KeyEvent2 keyEvent
type == 0
.private int state
private int type
keyEvent
is
valid).public KeyBindingState(@Nullable KeyBindings keyBindings, @Nullable KeyBindings keyBindings2, @Nullable CommandList commands)
keyBindings
- the KeyBindings
to modify; may be null
when removing bindingskeyBindings2
- the KeyBindings
to modify; only used when
removing bindings; may be null
when removing bindingscommands
- the commands to bind, or null
to unbindpublic void keyPressed(@NotNull KeyEvent2 keyEvent)
keyEvent
- the key that was pressedpublic boolean keyReleased()
true
if the dialog has finished, or false
if the
dialog is still active