mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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:
parent
3d91a48298
commit
0dcf28104d
3 changed files with 9 additions and 7 deletions
|
@ -1188,11 +1188,12 @@ String InputEventJoypadMotion::to_string() {
|
|||
return vformat("InputEventJoypadMotion: axis=%d, axis_value=%.2f", axis, axis_value);
|
||||
}
|
||||
|
||||
Ref<InputEventJoypadMotion> InputEventJoypadMotion::create_reference(JoyAxis p_axis, float p_value) {
|
||||
Ref<InputEventJoypadMotion> InputEventJoypadMotion::create_reference(JoyAxis p_axis, float p_value, int p_device) {
|
||||
Ref<InputEventJoypadMotion> ie;
|
||||
ie.instantiate();
|
||||
ie->set_axis(p_axis);
|
||||
ie->set_axis_value(p_value);
|
||||
ie->set_device(p_device);
|
||||
|
||||
return ie;
|
||||
}
|
||||
|
@ -1307,10 +1308,11 @@ String InputEventJoypadButton::to_string() {
|
|||
return vformat("InputEventJoypadButton: button_index=%d, pressed=%s, pressure=%.2f", button_index, p, pressure);
|
||||
}
|
||||
|
||||
Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(JoyButton p_btn_index) {
|
||||
Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(JoyButton p_btn_index, int p_device) {
|
||||
Ref<InputEventJoypadButton> ie;
|
||||
ie.instantiate();
|
||||
ie->set_button_index(p_btn_index);
|
||||
ie->set_device(p_device);
|
||||
|
||||
return ie;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue