22 package com.realtime.crossfire.jxclient.gui.keybindings;
25 import java.awt.event.KeyEvent;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
49 super(commands, isDefault);
66 public boolean equals(@Nullable
final Object obj) {
88 return this.keyEvent.equalsKeyCode(keyEvent);
105 final StringBuilder sb =
new StringBuilder();
109 sb.append(KeyEvent.getKeyModifiersText(modifiers)).append(
"+");
111 sb.append(KeyEvent.getKeyText(keyEvent.
getKeyCode()));
112 return sb.toString();
boolean isDefault()
Returns whether the key binding is a "default" binding which should not be saved. ...
boolean equalsKeyCode(@NotNull final KeyEvent2 keyEvent)
Returns whether this key event matches the same key code as another key event.
final KeyEvent2 keyEvent
The key to match.
KeyEvent2 getKeyEvent2()
Returns the key to match.
boolean matchesKeyCode(@NotNull final KeyEvent2 keyEvent)
boolean equals(@Nullable final Object obj)
final CommandList commands
The associated CommandList.
String getBindingDescription()
Represents a pressed or released key.
int getKeyCode()
Returns the key code.
int getModifiers()
Returns the modifiers.
KeyCodeKeyBinding(@NotNull final KeyEvent2 keyEvent, @NotNull final CommandList commands, final boolean isDefault)
Creates a KeyBinding that matches by key code/modifiers pair.
static final int NONE
The mask for "no modifier".
Abstract base class for key bindings.
A list of GUICommand instances.
A KeyBinding that matches by key code/modifiers pair.
boolean matchesKeyChar(final char keyChar)