Crossfire JXClient, Trunk
|
Public Member Functions | |
boolean | isRunningUsingCtrl () |
KeyHandler (@Nullable final Writer debugKeyboard, @NotNull final KeybindingsManager keybindingsManager, @NotNull final CommandQueue commandQueue, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final KeyHandlerListener keyHandlerListener) | |
void | keyPressed (@NotNull final KeyEvent e) |
void | keyReleased (@NotNull final KeyEvent e) |
void | setDefaultKeyBindings (@NotNull final KeyBindings defaultKeyBindings) |
Private Member Functions | |
void | debugKeyboardWrite (@NotNull final CharSequence message) |
void | debugKeyboardWrite (@NotNull final String type, @NotNull final KeyEvent keyEvent, @NotNull final KeyEvent2 keyEvent2) |
void | handleKeyPress (@NotNull final KeyEvent2 e) |
void | handleKeyRelease (@NotNull final KeyEvent2 e) |
void | updateModifiers (@NotNull final KeyEvent2 keyEvent) |
Private Attributes | |
final CommandQueue | commandQueue |
final Writer | debugKeyboard |
boolean | isRunningUsingCtrl |
final KeybindingsManager | keybindingsManager |
final KeyHandlerListener | keyHandlerListener |
final JXCWindowRenderer | windowRenderer |
Static Private Attributes | |
static final DateTimeFormatter | FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS ", Locale.ENGLISH) |
Handles keyboard input processing.
Definition at line 45 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 97 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 message to the keyboard debug.
message | the message to write |
Definition at line 316 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboard, and com.realtime.crossfire.jxclient.window.KeyHandler.FORMATTER.
|
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 304 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 |
Handles a "key pressed" event.
e | the key event to handle |
Definition at line 117 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.misc.JXCWindowRenderer.handleKeyPress(), 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 230 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().
boolean com.realtime.crossfire.jxclient.window.KeyHandler.isRunningUsingCtrl | ( | ) |
Returns whether the player is running because of the Ctrl key or not.
Definition at line 337 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.isRunningUsingCtrl.
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 260 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 274 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.setDefaultKeyBindings | ( | @NotNull final KeyBindings | defaultKeyBindings | ) |
Sets the default KeyBindings of the currently active skin.
defaultKeyBindings | the default key bindings |
Definition at line 109 of file KeyHandler.java.
References com.realtime.crossfire.jxclient.window.KeyHandler.keybindingsManager, and com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.setDefaultKeyBindings().
Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().
|
private |
Updates the saved modifier state from a key event.
keyEvent | the key event to process |
Definition at line 288 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(), com.realtime.crossfire.jxclient.window.KeyHandler.isRunningUsingCtrl, 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 64 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 52 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite(), and com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler().
|
staticprivate |
A formatter for timestamps.
Definition at line 82 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite().
|
private |
Whether the player is running because she is using the Ctrl key or not.
Definition at line 87 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.isRunningUsingCtrl(), and com.realtime.crossfire.jxclient.window.KeyHandler.updateModifiers().
|
private |
The KeybindingsManager to use.
Definition at line 58 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease(), com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler(), and com.realtime.crossfire.jxclient.window.KeyHandler.setDefaultKeyBindings().
|
private |
The KeyHandlerListener to notify.
Definition at line 76 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 JXCWindowRenderer to use.
Definition at line 70 of file KeyHandler.java.
Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress(), and com.realtime.crossfire.jxclient.window.KeyHandler.KeyHandler().