summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-08 15:22:31 +0100
committerGitHub <noreply@github.com>2022-02-08 15:22:31 +0100
commit2a39a1c2217a1d31826cd68f03cfdd8a0be769f0 (patch)
treed4c37c525145ce8eed50ff86a30471f83f190388 /platform
parente776580c3047bf4c7418362b7b55de993e52194b (diff)
parentb966ca6167beefc470c3469665200b542b1ea58a (diff)
Merge pull request #57612 from maiself/improve-gamepad-detection
Diffstat (limited to 'platform')
-rw-r--r--platform/linuxbsd/joypad_linux.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index 5eda42fea6..8e963238e3 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -333,8 +333,9 @@ void JoypadLinux::open_joypad(const char *p_path) {
}
// Check if the device supports basic gamepad events
- if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
- test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) {
+ bool has_abs_left = (test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit));
+ bool has_abs_right = (test_bit(ABS_RX, absbit) && test_bit(ABS_RY, absbit));
+ if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) && (has_abs_left || has_abs_right))) {
close(fd);
return;
}