From 8ef2c3d3672af2898b48187f4c4d9fe71f0e43d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Sat, 17 Aug 2024 21:44:37 +0800 Subject: [PATCH] Expanded the range of gamepad keycodes to be consistent with SDL Recently I was testing another PR (#95486). Although some devices use the mapping scheme in `core/input/gamecontrollerdb.txt`, the mapping of some keys still fails. By using `evemu-record` to test the buttons, it is found that the key codes of some buttons are not in the range of Godot test. Comparing the SDL code, it is found that the test ranges of the two are inconsistent. This may be the reason why some devices cannot work properly in Godot. --- platform/linuxbsd/joypad_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index a67428b9a48..3c0595bfbe9 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -309,7 +309,7 @@ void JoypadLinux::setup_joypad_properties(Joypad &p_joypad) { p_joypad.key_map[i] = num_buttons++; } } - for (int i = BTN_MISC; i < BTN_JOYSTICK; ++i) { + for (int i = 0; i < BTN_JOYSTICK; ++i) { if (test_bit(i, keybit)) { p_joypad.key_map[i] = num_buttons++; }