SettingsKeybindButton ​
Inherits: Control
Modern keybind button that works with any InputMap action dynamically
Variables ​
String | action_name | "" |
SettingsManager | settings_manager |
Methods ​
void | initialize( p_settings_manager: SettingsManager ) |
void | set_label() |
void | set_text_for_key() |
void | on_button_toggled( button_pressed: bool ) |
void | set_others_enabled( enabled: bool ) |
void | set_enabled( enabled: bool ) |
void | rebind_action_key( events: Array[InputEvent] ) |
void | set_action_name( new_action_name: String ) |
Signals ​
mouse_focus_changed( has_focus: bool, action_name: String, description: String ) ​
Emitted when the mouse enters or leaves the keybind: whether it has the focus, the name of the action and its text.
Variable descriptions ​
String action_name = "" ​
The InputMap action name (e.g. "move_up", "jump")
SettingsManager settings_manager ​
SettingsManagerRef
Method descriptions ​
void initialize( p_settings_manager: SettingsManager ) ​
Call this after instantiation to set up the control
void set_label() ​
Format the action name to be human-readable
void set_text_for_key() ​
Update the button text to show the currently assigned key
void on_button_toggled( button_pressed: bool ) ​
Handle button toggle state changes
void set_others_enabled( enabled: bool ) ​
Enable or disable all other hotkey buttons
void set_enabled( enabled: bool ) ​
Enable or disable this button
void rebind_action_key( events: Array[InputEvent] ) ​
Rebind the action to the new key/button
void set_action_name( new_action_name: String ) ​
Convenience method for dynamic creation