Class KeyHandler
- java.lang.Object
-
- com.realtime.crossfire.jxclient.window.KeyHandler
-
public class KeyHandler extends java.lang.ObjectHandles keyboard input processing.
-
-
Constructor Summary
Constructors Constructor Description KeyHandler(@Nullable java.io.Writer debugKeyboard, @NotNull KeybindingsManager keybindingsManager, @NotNull CommandQueue commandQueue, @NotNull JXCWindowRenderer windowRenderer, @NotNull KeyHandlerListener keyHandlerListener)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidkeyPressed(@NotNull java.awt.event.KeyEvent e)Handles a "key pressed" event.voidkeyReleased(@NotNull java.awt.event.KeyEvent e)Handles a "key released" event.voidsetKeyBindings(@NotNull KeyBindings keyBindings)Sets the activeKeyBindings.
-
-
-
Constructor Detail
-
KeyHandler
public KeyHandler(@Nullable @Nullable java.io.Writer debugKeyboard, @NotNull @NotNull KeybindingsManager keybindingsManager, @NotNull @NotNull CommandQueue commandQueue, @NotNull @NotNull JXCWindowRenderer windowRenderer, @NotNull @NotNull KeyHandlerListener keyHandlerListener)Creates a new instance.- Parameters:
debugKeyboard- the writer for logging keyboard debug output; maykeybindingsManager- the keybindings manager to usecommandQueue- the command queue to usewindowRenderer- the window renderer to usekeyHandlerListener- the key handler listener to notify
-
-
Method Detail
-
setKeyBindings
public void setKeyBindings(@NotNull @NotNull KeyBindings keyBindings)Sets the activeKeyBindings.- Parameters:
keyBindings- the key bindings ornullto unset
-
keyPressed
public void keyPressed(@NotNull @NotNull java.awt.event.KeyEvent e)Handles a "key pressed" event.- Parameters:
e- the key event to handle
-
keyReleased
public void keyReleased(@NotNull @NotNull java.awt.event.KeyEvent e)Handles a "key released" event.- Parameters:
e- the key event to handle
-
-