Explorar o código

issue-37239 add relaxation to conditions in the joystick check routine for being identified as joystick

(cherry picked from commit 36293f4256931d4693befb033880823eb4c0426e)
m6c7l %!s(int64=5) %!d(string=hai) anos
pai
achega
dec7014ca8
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      platform/x11/joypad_linux.cpp

+ 4 - 1
platform/x11/joypad_linux.cpp

@@ -342,7 +342,10 @@ void JoypadLinux::open_joypad(const char *p_path) {
 					(test_bit(ABS_X, absbit) || test_bit(ABS_Y, absbit) || test_bit(ABS_HAT0X, absbit) ||
 							test_bit(ABS_GAS, absbit) || test_bit(ABS_RUDDER, absbit)) &&
 					(test_bit(BTN_A, keybit) || test_bit(BTN_THUMBL, keybit) ||
-							test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_1, keybit)))) {
+							test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_1, keybit))) &&
+				!(test_bit(EV_ABS, evbit) &&
+						test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) &&
+						test_bit(ABS_RX, absbit) && test_bit(ABS_RY, absbit))) {
 			close(fd);
 			return;
 		}