Class KeyCharKeyBinding
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
-
- com.realtime.crossfire.jxclient.gui.keybindings.KeyCharKeyBinding
-
public class KeyCharKeyBinding extends KeyBinding
AKeyBinding
that matches by key character.
-
-
Constructor Summary
Constructors Constructor Description KeyCharKeyBinding(char keyChar, @NotNull CommandList commands, boolean isDefault)
Creates aKeyBinding
that matches by key character.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object obj)
@NotNull java.lang.String
getBindingDescription()
Return the binding as a human-readable text.char
getKeyChar()
Returns the key character to match.int
hashCode()
boolean
matchesKeyChar(char keyChar)
Check whether this key binding matches a key character.boolean
matchesKeyCode(@NotNull KeyEvent2 keyEvent)
Checks whether this key binding matches a key code/modifiers pair.-
Methods inherited from class com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
getCommands, getCommandString, isDefault
-
-
-
-
Constructor Detail
-
KeyCharKeyBinding
public KeyCharKeyBinding(char keyChar, @NotNull @NotNull CommandList commands, boolean isDefault)
Creates aKeyBinding
that matches by key character.- Parameters:
keyChar
- the key character to matchcommands
- the commands to associate with this bindingisDefault
- whether the key binding is a "default" binding which should not be saved
-
-
Method Detail
-
getKeyChar
public char getKeyChar()
Returns the key character to match.- Returns:
- the key character to match
-
equals
public boolean equals(@Nullable @Nullable java.lang.Object obj)
- Specified by:
equals
in classKeyBinding
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classKeyBinding
-
matchesKeyCode
public boolean matchesKeyCode(@NotNull @NotNull KeyEvent2 keyEvent)
Description copied from class:KeyBinding
Checks whether this key binding matches a key code/modifiers pair.- Specified by:
matchesKeyCode
in classKeyBinding
- Parameters:
keyEvent
- the key to check- Returns:
- whether the key binding matches the parameters
-
matchesKeyChar
public boolean matchesKeyChar(char keyChar)
Description copied from class:KeyBinding
Check whether this key binding matches a key character.- Specified by:
matchesKeyChar
in classKeyBinding
- Parameters:
keyChar
- the key character to check- Returns:
- whether the key binding matches the parameters
-
getBindingDescription
@NotNull public @NotNull java.lang.String getBindingDescription()
Description copied from class:KeyBinding
Return the binding as a human-readable text.- Specified by:
getBindingDescription
in classKeyBinding
- Returns:
- the human-readable text
-
-