Crossfire JXClient, Trunk
R20561
|
Handles keyboard input processing. More...
Public Member Functions | |
KeyHandler (@Nullable final Writer debugKeyboard, @NotNull final KeybindingsManager keybindingsManager, @NotNull final CommandQueue commandQueue, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final KeyHandlerListener keyHandlerListener) | |
Creates a new instance. More... | |
void | keyPressed (@NotNull final KeyEvent e) |
Handles a "key pressed" event. More... | |
void | keyReleased (@NotNull final KeyEvent e) |
Handles a "key released" event. More... | |
void | setKeyBindings (@NotNull final KeyBindings keyBindings) |
Sets the active KeyBindings. More... | |
Private Member Functions | |
void | debugKeyboardWrite (@NotNull final String type, @NotNull final KeyEvent keyEvent, @NotNull final KeyEvent2 keyEvent2) |
Writes a KeyEvent to the keyboard debug. More... | |
void | debugKeyboardWrite (@NotNull final CharSequence message) |
Writes a message to the keyboard debug. More... | |
void | handleKeyPress (@NotNull final KeyEvent2 e) |
Handles a "key pressed" event. More... | |
void | handleKeyRelease (@NotNull final KeyEvent2 e) |
Handles a "key released" event. More... | |
void | updateModifiers (@NotNull final KeyEvent2 keyEvent) |
Updates the saved modifier state from a key event. More... | |
Private Attributes | |
final CommandQueue | commandQueue |
The CommandQueue to use. More... | |
final Writer | debugKeyboard |
The Writer for logging keyboard debug output. More... | |
KeyBindings | keyBindings |
The active KeyBindings. More... | |
final KeybindingsManager | keybindingsManager |
The KeybindingsManager to use. More... | |
final KeyHandlerListener | keyHandlerListener |
The KeyHandlerListener to notify. More... | |
final DateFormat | simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS ") |
A formatter for timestamps. More... | |
final JXCWindowRenderer | windowRenderer |
The JXCWindowRenderer to use. More... | |
Handles keyboard input processing.
Definition at line 44 of file KeyHandler.java.
com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler | ( | @Nullable final Writer | debugKeyboard, |
@NotNull final KeybindingsManager | keybindingsManager, | ||
@NotNull final CommandQueue | commandQueue, | ||
@NotNull final JXCWindowRenderer | windowRenderer, | ||
@NotNull final KeyHandlerListener | keyHandlerListener | ||
) |
Creates a new instance.
debugKeyboard | the writer for logging keyboard debug output; may |
keybindingsManager | the keybindings manager to use |
commandQueue | the command queue to use |
windowRenderer | the window renderer to use |
keyHandlerListener | the key handler listener to notify |
Definition at line 98 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.commandQueue, com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboard, com.realtime.crossfire.jxclient.window.KeyHandler.keybindingsManager, com.realtime.crossfire.jxclient.window.KeyHandler.keyHandlerListener, and com.realtime.crossfire.jxclient.window.KeyHandler.windowRenderer.
|
private |
Writes a KeyEvent to the keyboard debug.
type | the event type |
keyEvent | the key event to write |
keyEvent2 | the key event to write |
Definition at line 307 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboard.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease(), com.realtime.crossfire.jxclient.window.KeyHandler.keyPressed(), com.realtime.crossfire.jxclient.window.KeyHandler.keyReleased(), and com.realtime.crossfire.jxclient.window.KeyHandler.updateModifiers().
|
private |
Writes a message to the keyboard debug.
message | the message to write |
Definition at line 319 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboard, and com.realtime.crossfire.jxclient.window.KeyHandler.simpleDateFormat.
|
private |
Handles a "key pressed" event.
e | the key event to handle |
Definition at line 119 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.queue.CommandQueue.addToRepeatCount(), com.realtime.crossfire.jxclient.window.KeyHandler.commandQueue, com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), com.realtime.crossfire.jxclient.window.KeyHandlerListener.escPressed(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getGuiState(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getOpenDialogs(), com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.handleKeyPress(), com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings.handleKeyPress(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.handleKeyPress(), com.realtime.crossfire.jxclient.window.KeyHandler.keyBindings, com.realtime.crossfire.jxclient.window.KeyHandler.keybindingsManager, com.realtime.crossfire.jxclient.window.KeyHandler.keyHandlerListener, com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyPressed(), com.realtime.crossfire.jxclient.gui.keybindings.KeyEvent2.NONE, com.realtime.crossfire.jxclient.window.KeyHandler.updateModifiers(), and com.realtime.crossfire.jxclient.window.KeyHandler.windowRenderer.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.keyPressed().
|
private |
Handles a "key released" event.
e | the key event to handle |
Definition at line 237 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), com.realtime.crossfire.jxclient.window.KeyHandler.keybindingsManager, com.realtime.crossfire.jxclient.window.KeyHandler.keyHandlerListener, com.realtime.crossfire.jxclient.window.KeyHandlerListener.keyReleased(), com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyReleased(), and com.realtime.crossfire.jxclient.window.KeyHandler.updateModifiers().
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.keyReleased().
void com.realtime.crossfire.jxclient.window.KeyHandler.keyPressed | ( | @NotNull final KeyEvent | e | ) |
Handles a "key pressed" event.
e | the key event to handle |
Definition at line 267 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), and com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress().
void com.realtime.crossfire.jxclient.window.KeyHandler.keyReleased | ( | @NotNull final KeyEvent | e | ) |
Handles a "key released" event.
e | the key event to handle |
Definition at line 281 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), and com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease().
void com.realtime.crossfire.jxclient.window.KeyHandler.setKeyBindings | ( | @NotNull final KeyBindings | keyBindings | ) |
Sets the active KeyBindings.
keyBindings | the key bindings or null |
Definition at line 111 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.keyBindings.
Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.init().
|
private |
Updates the saved modifier state from a key event.
keyEvent | the key event to process |
Definition at line 295 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.commandQueue, com.realtime.crossfire.jxclient.gui.keybindings.KeyEvent2.CTRL, com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), and com.realtime.crossfire.jxclient.queue.CommandQueue.stopRunning().
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), and com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease().
|
private |
The CommandQueue to use.
Definition at line 63 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler(), and com.realtime.crossfire.jxclient.window.KeyHandler.updateModifiers().
|
private |
The Writer for logging keyboard debug output.
Log nothing if
.
Definition at line 51 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), and com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler().
|
private |
The active KeyBindings.
Set to
when no key bindings are active.
Definition at line 88 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), and com.realtime.crossfire.jxclient.window.KeyHandler.setKeyBindings().
|
private |
The KeybindingsManager to use.
Definition at line 57 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease(), and com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler().
|
private |
The KeyHandlerListener to notify.
Definition at line 75 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease(), and com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler().
|
private |
A formatter for timestamps.
Definition at line 81 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite().
|
private |
The JXCWindowRenderer to use.
Definition at line 69 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), and com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler().