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.
This commit is contained in:
风青山 2024-08-17 21:44:37 +08:00
parent 568589c9d8
commit 8ef2c3d367
No known key found for this signature in database
GPG Key ID: 056264D70ECB0FD5

View File

@ -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++;
}