Skip to content

SettingsKeybindButton ​

Inherits: Control

Modern keybind button that works with any InputMap action dynamically

Variables ​

Stringaction_name""
SettingsManagersettings_manager

Methods ​

voidinitialize( p_settings_manager: SettingsManager )
voidset_label()
voidset_text_for_key()
voidon_button_toggled( button_pressed: bool )
voidset_others_enabled( enabled: bool )
voidset_enabled( enabled: bool )
voidrebind_action_key( events: Array[InputEvent] )
voidset_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