Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.window.KeyHandler Class Reference

Handles keyboard input processing. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.window.KeyHandler:

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...
 

Detailed Description

Handles keyboard input processing.

Author
Lauwenmark
Andreas Kirschbaum

Definition at line 44 of file KeyHandler.java.

Constructor & Destructor Documentation

◆ KeyHandler()

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.

Parameters
debugKeyboardthe writer for logging keyboard debug output; may
keybindingsManagerthe keybindings manager to use
commandQueuethe command queue to use
windowRendererthe window renderer to use
keyHandlerListenerthe 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.

Member Function Documentation

◆ debugKeyboardWrite() [1/2]

void com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite ( @NotNull final String  type,
@NotNull final KeyEvent  keyEvent,
@NotNull final KeyEvent2  keyEvent2 
)
private

◆ debugKeyboardWrite() [2/2]

void com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite ( @NotNull final CharSequence  message)
private

Writes a message to the keyboard debug.

Parameters
messagethe 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.

◆ handleKeyPress()

void com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress ( @NotNull final KeyEvent2  e)
private

◆ handleKeyRelease()

◆ keyPressed()

void com.realtime.crossfire.jxclient.window.KeyHandler.keyPressed ( @NotNull final KeyEvent  e)

Handles a "key pressed" event.

Parameters
ethe 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().

+ Here is the call graph for this function:

◆ keyReleased()

void com.realtime.crossfire.jxclient.window.KeyHandler.keyReleased ( @NotNull final KeyEvent  e)

Handles a "key released" event.

Parameters
ethe 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().

+ Here is the call graph for this function:

◆ setKeyBindings()

void com.realtime.crossfire.jxclient.window.KeyHandler.setKeyBindings ( @NotNull final KeyBindings  keyBindings)

Sets the active KeyBindings.

Parameters
keyBindingsthe key bindings or
null
to unset

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().

+ Here is the caller graph for this function:

◆ updateModifiers()

void com.realtime.crossfire.jxclient.window.KeyHandler.updateModifiers ( @NotNull final KeyEvent2  keyEvent)
private

Member Data Documentation

◆ commandQueue

◆ debugKeyboard

final Writer com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboard
private

The Writer for logging keyboard debug output.

Log nothing if

null

.

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().

◆ keyBindings

KeyBindings com.realtime.crossfire.jxclient.window.KeyHandler.keyBindings
private

The active KeyBindings.

Set to

null

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().

◆ keybindingsManager

◆ keyHandlerListener

◆ simpleDateFormat

final DateFormat com.realtime.crossfire.jxclient.window.KeyHandler.simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS ")
private

A formatter for timestamps.

Definition at line 81 of file KeyHandler.java.

Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.debugKeyboardWrite().

◆ windowRenderer

final JXCWindowRenderer com.realtime.crossfire.jxclient.window.KeyHandler.windowRenderer
private

The documentation for this class was generated from the following file: