Class KeyCodeKeyBinding
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
-
- com.realtime.crossfire.jxclient.gui.keybindings.KeyCodeKeyBinding
-
public class KeyCodeKeyBinding extends KeyBinding
AKeyBindingthat matches by key code/modifiers pair.
-
-
Constructor Summary
Constructors Constructor Description KeyCodeKeyBinding(@NotNull KeyEvent2 keyEvent, @NotNull CommandList commands, boolean isDefault)Creates aKeyBindingthat matches by key code/modifiers pair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(@Nullable java.lang.Object obj)@NotNull java.lang.StringgetBindingDescription()Return the binding as a human-readable text.@NotNull KeyEvent2getKeyEvent2()Returns the key to match.inthashCode()booleanmatchesKeyChar(char keyChar)Check whether this key binding matches a key character.booleanmatchesKeyCode(@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 aKeyBindingthat 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:
equalsin classKeyBinding
-
hashCode
public int hashCode()
- Specified by:
hashCodein classKeyBinding
-
matchesKeyCode
public boolean matchesKeyCode(@NotNull @NotNull KeyEvent2 keyEvent)Description copied from class:KeyBindingChecks whether this key binding matches a key code/modifiers pair.- Specified by:
matchesKeyCodein 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:KeyBindingCheck whether this key binding matches a key character.- Specified by:
matchesKeyCharin 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:KeyBindingReturn the binding as a human-readable text.- Specified by:
getBindingDescriptionin classKeyBinding- Returns:
- the human-readable text
-
-