java.lang.Objectcom.realtime.crossfire.jxclient.window.KeybindingsManager
public class KeybindingsManager
Manages key bindings.
| Field Summary | |
|---|---|
private KeyBindings |
characterKeyBindings
The key bindings for the current user. |
private CommandCallback |
commandCallback
The CommandCallback to use. |
private Commands |
commands
The commands instance to use. |
private KeyBindings |
keyBindings
The global key bindings. |
private KeyBindingState |
keyBindingState
The current key binding state. |
private Macros |
macros
The Macros instance to use. |
| Constructor Summary | |
|---|---|
KeybindingsManager(Commands commands,
CommandCallback commandCallback,
Macros macros)
Creates a new instance. |
|
| Method Summary | |
|---|---|
boolean |
createKeyBinding(boolean perCharacter,
CommandList cmdList)
Starts creating a new key binding. |
boolean |
escPressed()
Processes a pressed ESC key. |
private KeyBindings |
getKeyBindings(boolean perCharacter)
Returns the active key bindings. |
boolean |
handleKeyPress(java.awt.event.KeyEvent e)
Processes a key pressed event. |
boolean |
handleKeyTyped(java.awt.event.KeyEvent e)
Processes a key typed event. |
boolean |
keyPressed(int keyCode,
int modifiers)
Processes a key pressed event. |
boolean |
keyReleased()
Processes a key released event. |
boolean |
keyTyped(char keyChar)
Processes a key typed event. |
void |
loadKeybindings()
Loads the key bindings from the backing file. |
void |
loadPerCharacterBindings(java.lang.CharSequence hostname,
java.lang.CharSequence character)
Loads the per-character key bindings. |
boolean |
removeKeyBinding(boolean perCharacter)
Starts to remove a key binding. |
void |
saveKeybindings()
Saves the key bindings to the backing file. |
void |
unloadPerCharacterBindings()
Unloads (clears and saves) the per-character key bindings. |
boolean |
windowClosing()
Should be called when the main window is closing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Nullable private KeyBindings characterKeyBindings
null if no
user is logged in.
@NotNull private final CommandCallback commandCallback
CommandCallback to use.
@NotNull private final Commands commands
@NotNull private final KeyBindings keyBindings
@Nullable private KeyBindingState keyBindingState
null if no key binding
dialog is active.
@NotNull private final Macros macros
Macros instance to use.
| Constructor Detail |
|---|
public KeybindingsManager(@NotNull
Commands commands,
@NotNull
CommandCallback commandCallback,
@NotNull
Macros macros)
commands - the commands instance to usecommandCallback - the command callback to usemacros - the macros instance to use| Method Detail |
|---|
public boolean createKeyBinding(boolean perCharacter,
@NotNull
CommandList cmdList)
perCharacter - whether a per-character key bindings should be
createdcmdList - the commands for the key binding
public boolean escPressed()
@Nullable private KeyBindings getKeyBindings(boolean perCharacter)
perCharacter - if set, return the per-character key bindings; else
return the global bindings
null if no per-character
bindings exist because no character is logged in
public boolean handleKeyPress(@NotNull
java.awt.event.KeyEvent e)
e - the key event
public boolean handleKeyTyped(@NotNull
java.awt.event.KeyEvent e)
e - the key event
public boolean keyPressed(int keyCode,
int modifiers)
keyCode - the character code of the key eventmodifiers - the modifiers of the key event
public boolean keyReleased()
public boolean keyTyped(char keyChar)
keyChar - the character information of the key event
public void loadKeybindings()
public void loadPerCharacterBindings(@NotNull
java.lang.CharSequence hostname,
@NotNull
java.lang.CharSequence character)
hostname - the character's hostnamecharacter - the character's namepublic boolean removeKeyBinding(boolean perCharacter)
perCharacter - whether a per-character key binding should be
removed
public void saveKeybindings()
public void unloadPerCharacterBindings()
public boolean windowClosing()