struct

Egui::Hotkey

Inherits Struct < Value < Object

A key combo: modifiers plus a KeyCode. Canonical string form is "Ctrl+Alt+Shift+Super+<Key>" (only the pressed parts shown), key names matching the KeyCode members ("Ctrl+N", "F5", "Ctrl+Shift+Z", "Ctrl+Space").

Constants

KEY_ALIASES = {"esc" => "escape", "return" => "enter", "bksp" => "backspace", "ins" => "insert", "del" => "delete", "pgup" => "pageup", "pgdn" => "pagedown", "pgdown" => "pagedown", "arrowleft" => "left", "arrowright" => "right", "arrowup" => "up", "arrowdown" => "down"}

Parse-friendly aliases for named keys ("Esc" → Escape…).

Constructors

new(key : KeyCode, ctrl : Bool = false, shift : Bool = false, alt : Bool = false, super_key : Bool = false)
Source
new(key : KeyCode, modifiers : Modifiers)

From live modifier state (e.g. what HotkeyEdit captured).

Source
parse(str : String) : Hotkey

Strict parse — raises ArgumentError on an unknown key or combo (a typo'd default binding should fail loudly at startup).

Source

Class methods

key_name(key : KeyCode) : String

Display name of a bare key: digits render as the digit, named keys as the enum member ("Space", "F5", "Escape").

Source
parse?(str : String) : Hotkey | Nil

Modifier tokens (case-insensitive); "super" also parses under the cmd/win/meta spellings.

Source

Instance methods

==(other : Hotkey) : Bool
Source
ctrl
Source
hash(hasher)

See Object#hash(hasher)

Source
matches?(input : InputState) : Bool

This hotkey was pressed this frame (key press + exact modifier state — "Ctrl+N" does not match Ctrl+Shift+N).

Source
modifiers_match?(m : Modifiers) : Bool
Source
shift
Source
super_key
Source
to_s

"Ctrl+N", "Ctrl+Shift+Z", "F5" — the display form menus use.

Source