public class KeyHandler
extends java.lang.Object
Constructor and Description |
---|
KeyHandler(@Nullable java.io.Writer debugKeyboard,
@NotNull KeybindingsManager keybindingsManager,
@NotNull CommandQueue commandQueue,
@NotNull JXCWindowRenderer windowRenderer,
@NotNull KeyHandlerListener keyHandlerListener)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isRunningUsingCtrl()
Returns whether the player is running because of the Ctrl key or not.
|
void |
keyPressed(@NotNull java.awt.event.KeyEvent e)
Handles a "key pressed" event.
|
void |
keyReleased(@NotNull java.awt.event.KeyEvent e)
Handles a "key released" event.
|
void |
setDefaultKeyBindings(@NotNull KeyBindings defaultKeyBindings)
Sets the default
KeyBindings of the currently active skin. |
public KeyHandler(@Nullable @Nullable java.io.Writer debugKeyboard, @NotNull @NotNull KeybindingsManager keybindingsManager, @NotNull @NotNull CommandQueue commandQueue, @NotNull @NotNull JXCWindowRenderer windowRenderer, @NotNull @NotNull KeyHandlerListener keyHandlerListener)
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 notifypublic void setDefaultKeyBindings(@NotNull @NotNull KeyBindings defaultKeyBindings)
KeyBindings
of the currently active skin.defaultKeyBindings
- the default key bindingspublic void keyPressed(@NotNull @NotNull java.awt.event.KeyEvent e)
e
- the key event to handlepublic void keyReleased(@NotNull @NotNull java.awt.event.KeyEvent e)
e
- the key event to handlepublic boolean isRunningUsingCtrl()