struct
Opal::Input::Core::InputBinding
- Opal::Input::Core::InputBinding
- Struct
- Value
- Object
Overview
Pure value-type representing a single physical input trigger (key, mouse button, or gamepad button/axis).
Defined in:
opal/input/core/remap_model.crConstructors
-
.from_key_event(event : Terminal::KeyEvent) : InputBinding
Creates an InputBinding directly from a terminal KeyEvent.
-
.from_mouse_event(event : Terminal::MouseEvent) : InputBinding
Creates an InputBinding directly from a terminal MouseEvent.
- .new(code : String, device : DeviceType = DeviceType::Keyboard, ctrl : Bool = false, alt : Bool = false, shift : Bool = false, axis_direction : Int32 = 0)
-
.parse(descriptor : String, default_device : DeviceType = DeviceType::Keyboard) : InputBinding
Parses a human-readable descriptor string such as "ctrl+shift+s", "space", "mouse:left", "pad:south", "gamepad:l2", "xbox:a", or "ps2:cross".
Class Method Summary
Instance Method Summary
- #alt=(alt : Bool)
- #alt? : Bool
- #axis_direction : Int32
- #axis_direction=(axis_direction : Int32)
- #code : String
- #code=(code : String)
- #ctrl=(ctrl : Bool)
- #ctrl? : Bool
-
#descriptor : String
Canonical string descriptor suitable for Opal::Input::KeyMap and serialization.
- #device : DeviceType
- #device=(device : DeviceType)
-
#display_label(gamepad_style : GamepadStyle = GamepadStyle::DualShock) : String
Formats a human-friendly keycap badge label for UI rendering.
- #empty? : Bool
-
#matches?(event : Terminal::KeyEvent) : Bool
Checks whether this binding matches a live Terminal::KeyEvent.
-
#matches?(event : Terminal::MouseEvent) : Bool
Checks whether this binding matches a live Terminal::MouseEvent.
- #shift=(shift : Bool)
- #shift? : Bool
-
#to_lapis_symbol : String
Converts this binding to its Godot 4.8 / Lapis key or joypad constant identifier.
Constructor Detail
Creates an InputBinding directly from a terminal KeyEvent.
Creates an InputBinding directly from a terminal MouseEvent.
Parses a human-readable descriptor string such as "ctrl+shift+s", "space", "mouse:left", "pad:south", "gamepad:l2", "xbox:a", or "ps2:cross".
Class Method Detail
Instance Method Detail
Canonical string descriptor suitable for Opal::Input::KeyMap and serialization.
Formats a human-friendly keycap badge label for UI rendering.
Checks whether this binding matches a live Terminal::KeyEvent.
Checks whether this binding matches a live Terminal::MouseEvent.
Converts this binding to its Godot 4.8 / Lapis key or joypad constant identifier.