Package megamek.client.ui.util
Enum Class KeyCommandBind
- All Implemented Interfaces:
Serializable
,Comparable<KeyCommandBind>
,Constable
This enum is a collection of commands that can be bound to a particular key.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUsed to cancel moves/fires/chatterboxCenter on the currently selected unit.Toggles between Jumping and Walk/Run, also acts as a reset when a unit cannot jump -
Field Summary
FieldsModifier and TypeFieldDescriptionThe command associated with this binding.boolean
Defines if an action is exclusive, which means that only one CommandAction will be performed for each key press.boolean
When true, this keybind is used by the CommonMenuBar.boolean
For a repeatable bind, when the key is pressed the action will be added to a timer and repeated until the key is released.int
Defines the keycode for the command, e.g.int
int
Modifiers to the key code, such as InputEvent.CTRL_DOWN_MASK.int
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyCommandBind
getBindByCmd
(String cmd) Returns the bind identified by the given cmd or null if there is no such bind.static List<KeyCommandBind>
getBindByKey
(int keycode, int modifiers) Returns a list of binds using the given keycode and modifier.static String
returns formatted mod + key for displaystatic KeyStroke
keyStroke
(KeyCommandBind bind) Returns a KeyStroke for a given KeyCommandBind.static KeyCommandBind
Returns the enum constant of this class with the specified name.static KeyCommandBind[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SCROLL_NORTH
-
SCROLL_SOUTH
-
SCROLL_EAST
-
SCROLL_WEST
-
TOGGLE_CHAT
-
TOGGLE_CHAT_CMD
-
DEPLOY_TURNUNIT
-
MOVE_STEPFORWARD
-
MOVE_STEPBACKWARD
-
TURN_LEFT
-
TURN_RIGHT
-
TWIST_LEFT
-
TWIST_RIGHT
-
FIRE
-
NEXT_WEAPON
-
PREV_WEAPON
-
NEXT_UNIT
-
PREV_UNIT
-
NEXT_TARGET
-
PREV_TARGET
-
NEXT_TARGET_VALID
-
PREV_TARGET_VALID
-
NEXT_TARGET_NOALLIES
-
PREV_TARGET_NOALLIES
-
NEXT_TARGET_VALID_NO_ALLIES
-
PREV_TARGET_VALID_NO_ALLIES
-
PHYS_PUNCH
-
PHYS_KICK
-
PHYS_PUSH
-
VIEW_ACTING_UNIT
-
UNDO_LAST_STEP
-
UNDO
-
REDO
-
CENTER_ON_SELECTED
Center on the currently selected unit. -
AUTO_ARTY_DEPLOYMENT_ZONE
-
CANCEL
Used to cancel moves/fires/chatterbox -
DONE
-
DONE_NO_ACTION
-
UD_GENERAL
-
UD_PILOT
-
UD_ARMOR
-
UD_WEAPONS
-
UD_SYSTEMS
-
UD_EXTRAS
-
TOGGLE_MOVEMODE
Toggles between Jumping and Walk/Run, also acts as a reset when a unit cannot jump -
MOVE_BACKUP
-
MOVE_GOPRONE
-
MOVE_GETUP
-
TOGGLE_CONVERSIONMODE
-
PREV_MODE
-
NEXT_MODE
-
PAUSE
-
UNPAUSE
-
REPORT_KEY_NEXT
-
REPORT_KEY_PREV
-
REPORT_KEY_SELNEXT
-
REPORT_KEY_SELPREV
-
REPORT_KEY_FILTER
-
TOGGLE_ISO
-
MOVE_ENVELOPE
-
FIELD_FIRE
-
DRAW_LABELS
-
HEX_COORDS
-
MINIMAP
-
LOS_SETTING
-
UNIT_DISPLAY
-
UNIT_OVERVIEW
-
KEY_BINDS
-
PLANETARY_CONDITIONS
-
TURN_DETAILS
-
CLIENT_SETTINGS
-
INC_GUISCALE
-
DEC_GUISCALE
-
ROUND_REPORT
-
ZOOM_IN
-
ZOOM_OUT
-
QUICK_LOAD
-
QUICK_SAVE
-
LOCAL_LOAD
-
LOCAL_SAVE
-
REPLACE_PLAYER
-
MOD_ENVELOPE
-
SENSOR_RANGE
-
UNDO_SINGLE_STEP
-
FORCE_DISPLAY
-
EXTEND_TURN_TIMER
-
BOT_COMMANDS
-
-
Field Details
-
cmd
The command associated with this binding. -
key
public int keyDefines the keycode for the command, e.g. KeyEvent.VK_X. -
keyDefault
public int keyDefault -
modifiers
public int modifiersModifiers to the key code, such as InputEvent.CTRL_DOWN_MASK. -
modifiersDefault
public int modifiersDefault -
isExclusive
public boolean isExclusiveDefines if an action is exclusive, which means that only one CommandAction will be performed for each key press. The CommandAction that is performed will be the first one encountered. Exclusive binds can't share their key with other binds. -
isRepeatable
public boolean isRepeatableFor a repeatable bind, when the key is pressed the action will be added to a timer and repeated until the key is released. -
isMenuBar
public boolean isMenuBarWhen true, this keybind is used by the CommonMenuBar. Binding it with the MegaMekController like the other keybinds is not necessary (and will not work, as the command will not be recognized in this way).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getBindByKey
Returns a list of binds using the given keycode and modifier. Only lists those that are not used by the CommonMenuBar! -
getBindByCmd
Returns the bind identified by the given cmd or null if there is no such bind. -
keyStroke
Returns a KeyStroke for a given KeyCommandBind. -
getDesc
returns formatted mod + key for display
-