public abstract static class KeyBindingRegistry.KeyHandler extends java.lang.Object implements ITickHandler
Modifier and Type | Field and Description |
---|---|
protected KeyBinding[] |
keyBindings |
protected boolean[] |
keyDown |
protected boolean[] |
repeatings |
Constructor and Description |
---|
KeyBindingRegistry.KeyHandler(KeyBinding[] keyBindings)
Register the keys into the system.
|
KeyBindingRegistry.KeyHandler(KeyBinding[] keyBindings,
boolean[] repeatings)
Pass an array of keybindings and a repeat flag for each one
|
Modifier and Type | Method and Description |
---|---|
KeyBinding[] |
getKeyBindings() |
abstract void |
keyDown(java.util.EnumSet<TickType> types,
KeyBinding kb,
boolean tickEnd,
boolean isRepeat)
Called when the key is first in the down position on any tick from the
ticks()
set. |
abstract void |
keyUp(java.util.EnumSet<TickType> types,
KeyBinding kb,
boolean tickEnd)
Fired once when the key changes state from down to up
|
void |
tickEnd(java.util.EnumSet<TickType> type,
java.lang.Object... tickData)
Not to be overridden - KeyBindings are tickhandlers under the covers
|
abstract java.util.EnumSet<TickType> |
ticks()
This is the list of ticks for which the key binding should trigger.
|
void |
tickStart(java.util.EnumSet<TickType> type,
java.lang.Object... tickData)
Not to be overridden - KeyBindings are tickhandlers under the covers
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLabel
protected KeyBinding[] keyBindings
protected boolean[] keyDown
protected boolean[] repeatings
public KeyBindingRegistry.KeyHandler(KeyBinding[] keyBindings, boolean[] repeatings)
keyBindings
- repeatings
- public KeyBindingRegistry.KeyHandler(KeyBinding[] keyBindings)
keyBindings
- public KeyBinding[] getKeyBindings()
public final void tickStart(java.util.EnumSet<TickType> type, java.lang.Object... tickData)
tickStart
in interface ITickHandler
public final void tickEnd(java.util.EnumSet<TickType> type, java.lang.Object... tickData)
tickEnd
in interface ITickHandler
public abstract void keyDown(java.util.EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat)
ticks()
set. Will be called subsequently with isRepeat set to truetypes
- the type(s) of tick that fired when this key was first downtickEnd
- was it an end or start tick which fired the keyisRepeat
- is it a repeat key eventkeyUp(EnumSet, KeyBinding, boolean)
public abstract void keyUp(java.util.EnumSet<TickType> types, KeyBinding kb, boolean tickEnd)
types
- the type(s) of tick that fired when this key was first downtickEnd
- was it an end or start tick which fired the keykeyDown(EnumSet, KeyBinding, boolean, boolean)
public abstract java.util.EnumSet<TickType> ticks()
ticks
in interface ITickHandler
ITickHandler.ticks()