Class KeyCodeKeyBinding
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
-
- com.realtime.crossfire.jxclient.gui.keybindings.KeyCodeKeyBinding
-
public class KeyCodeKeyBinding extends KeyBinding
AKeyBinding
that matches by key code/modifiers pair.
-
-
Constructor Summary
Constructors Constructor Description KeyCodeKeyBinding(@NotNull KeyEvent2 keyEvent, @NotNull CommandList commands, boolean isDefault)
Creates aKeyBinding
that matches by key code/modifiers pair.
-
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.@NotNull KeyEvent2
getKeyEvent2()
Returns the key 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
-
KeyCodeKeyBinding
public KeyCodeKeyBinding(@NotNull @NotNull KeyEvent2 keyEvent, @NotNull @NotNull CommandList commands, boolean isDefault)
Creates aKeyBinding
that matches by key code/modifiers pair.- Parameters:
keyEvent
- the key to matchcommands
- the commands to associate with this bindingisDefault
- whether the key binding is a "default" binding which should not be saved
-
-
Method Detail
-
getKeyEvent2
@NotNull public @NotNull KeyEvent2 getKeyEvent2()
Returns the key to match.- Returns:
- the key 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
-
-