summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/joypad_linux.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-09 16:47:04 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-09 16:47:04 +0200
commit49a61713198ba53b1ebcd1494651629b451e94e7 (patch)
tree9316a94bb0c1af702270f5c2665c80e8173313cd /platform/linuxbsd/joypad_linux.h
parent82cedc83c9069125207c128f9a07ce3d82c317cc (diff)
parent724cdffc8cd12f86d8f509fd56f4ef7165862d3b (diff)
downloadredot-engine-49a61713198ba53b1ebcd1494651629b451e94e7.tar.gz
Merge pull request #93352 from Calinou/linuxbsd-controller-no-trackpad-graphics-tablet
Fix trackpads and graphics tablets being recognized as controllers on Linux/*BSD
Diffstat (limited to 'platform/linuxbsd/joypad_linux.h')
-rw-r--r--platform/linuxbsd/joypad_linux.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/linuxbsd/joypad_linux.h b/platform/linuxbsd/joypad_linux.h
index 26a9908d4e..bf24d8e5a5 100644
--- a/platform/linuxbsd/joypad_linux.h
+++ b/platform/linuxbsd/joypad_linux.h
@@ -94,6 +94,21 @@ private:
Vector<String> attached_devices;
+ // List of lowercase words that will prevent the controller from being recognized if its name matches.
+ // This is done to prevent trackpads, graphics tablets and motherboard LED controllers from being
+ // recognized as controllers (and taking up controller ID slots as a result).
+ // Only whole words are matched within the controller name string. The match is case-insensitive.
+ const Vector<String> banned_words = {
+ "touchpad", // Matches e.g. "SynPS/2 Synaptics TouchPad", "Sony Interactive Entertainment DualSense Wireless Controller Touchpad"
+ "trackpad",
+ "clickpad",
+ "keyboard", // Matches e.g. "PG-90215 Keyboard", "Usb Keyboard Usb Keyboard Consumer Control"
+ "mouse", // Matches e.g. "Mouse passthrough"
+ "pen", // Matches e.g. "Wacom One by Wacom S Pen"
+ "finger", // Matches e.g. "Wacom HID 495F Finger"
+ "led", // Matches e.g. "ASRock LED Controller"
+ };
+
static void monitor_joypads_thread_func(void *p_user);
void monitor_joypads_thread_run();