1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Allow all gamepad devices for built-in ui_* input actions

This allows all controllers to navigate the UI, which enhances
compatibility with PC handhelds when external controllers are connected.

Previously, only the first device was allowed to use `ui_*` actions
out of the box, which means that on a PC handheld, external controllers
couldn't navigate the UI (since the first ID is always the built-in controller).
This commit is contained in:
Hugo Locurcio
2025-09-23 17:12:56 +02:00
parent 3d91a48298
commit 0dcf28104d
3 changed files with 9 additions and 7 deletions

View File

@@ -527,10 +527,8 @@ void InputEventConfigurationDialog::_input_list_item_selected() {
} break;
case INPUT_JOY_BUTTON: {
JoyButton idx = (JoyButton)(int)selected->get_meta("__index");
Ref<InputEventJoypadButton> jb = InputEventJoypadButton::create_reference(idx);
// Maintain selected device
jb->set_device(_get_current_device());
Ref<InputEventJoypadButton> jb = InputEventJoypadButton::create_reference(idx, _get_current_device());
_set_event(jb, jb, false);
} break;