Fixed the ROCCAT Tyon mouse showing up as a joystick on Windows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 12942a5..67ece2a 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -1347,11 +1347,121 @@ static SDL_bool SDL_IsPS4RemapperRunning(void)
SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
{
+ /* This list is taken from:
+ https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py
+ */
+ static Uint32 joystick_blacklist[] = {
+ /* Microsoft Microsoft Wireless Optical Desktop® 2.10 */
+ /* Microsoft Wireless Desktop - Comfort Edition */
+ MAKE_VIDPID(0x045e, 0x009d),
+
+ /* Microsoft Microsoft® Digital Media Pro Keyboard */
+ /* Microsoft Corp. Digital Media Pro Keyboard */
+ MAKE_VIDPID(0x045e, 0x00b0),
+
+ /* Microsoft Microsoft® Digital Media Keyboard */
+ /* Microsoft Corp. Digital Media Keyboard 1.0A */
+ MAKE_VIDPID(0x045e, 0x00b4),
+
+ /* Microsoft Microsoft® Digital Media Keyboard 3000 */
+ MAKE_VIDPID(0x045e, 0x0730),
+
+ /* Microsoft Microsoft® 2.4GHz Transceiver v6.0 */
+ /* Microsoft Microsoft® 2.4GHz Transceiver v8.0 */
+ /* Microsoft Corp. Nano Transceiver v1.0 for Bluetooth */
+ /* Microsoft Wireless Mobile Mouse 1000 */
+ /* Microsoft Wireless Desktop 3000 */
+ MAKE_VIDPID(0x045e, 0x0745),
+
+ /* Microsoft® SideWinder(TM) 2.4GHz Transceiver */
+ MAKE_VIDPID(0x045e, 0x0748),
+
+ /* Microsoft Corp. Wired Keyboard 600 */
+ MAKE_VIDPID(0x045e, 0x0750),
+
+ /* Microsoft Corp. Sidewinder X4 keyboard */
+ MAKE_VIDPID(0x045e, 0x0768),
+
+ /* Microsoft Corp. Arc Touch Mouse Transceiver */
+ MAKE_VIDPID(0x045e, 0x0773),
+
+ /* Microsoft® 2.4GHz Transceiver v9.0 */
+ /* Microsoft® Nano Transceiver v2.1 */
+ /* Microsoft Sculpt Ergonomic Keyboard (5KV-00001) */
+ MAKE_VIDPID(0x045e, 0x07a5),
+
+ /* Microsoft® Nano Transceiver v1.0 */
+ /* Microsoft Wireless Keyboard 800 */
+ MAKE_VIDPID(0x045e, 0x07b2),
+
+ /* Microsoft® Nano Transceiver v2.0 */
+ MAKE_VIDPID(0x045e, 0x0800),
+
+ MAKE_VIDPID(0x046d, 0xc30a), /* Logitech, Inc. iTouch Composite keboard */
+
+ MAKE_VIDPID(0x04d9, 0xa0df), /* Tek Syndicate Mouse (E-Signal USB Gaming Mouse) */
+
+ /* List of Wacom devices at: http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs */
+ MAKE_VIDPID(0x056a, 0x0010), /* Wacom ET-0405 Graphire */
+ MAKE_VIDPID(0x056a, 0x0011), /* Wacom ET-0405A Graphire2 (4x5) */
+ MAKE_VIDPID(0x056a, 0x0012), /* Wacom ET-0507A Graphire2 (5x7) */
+ MAKE_VIDPID(0x056a, 0x0013), /* Wacom CTE-430 Graphire3 (4x5) */
+ MAKE_VIDPID(0x056a, 0x0014), /* Wacom CTE-630 Graphire3 (6x8) */
+ MAKE_VIDPID(0x056a, 0x0015), /* Wacom CTE-440 Graphire4 (4x5) */
+ MAKE_VIDPID(0x056a, 0x0016), /* Wacom CTE-640 Graphire4 (6x8) */
+ MAKE_VIDPID(0x056a, 0x0017), /* Wacom CTE-450 Bamboo Fun (4x5) */
+ MAKE_VIDPID(0x056a, 0x0018), /* Wacom CTE-650 Bamboo Fun 6x8 */
+ MAKE_VIDPID(0x056a, 0x0019), /* Wacom CTE-631 Bamboo One */
+ MAKE_VIDPID(0x056a, 0x00d1), /* Wacom Bamboo Pen and Touch CTH-460 */
+ MAKE_VIDPID(0x056a, 0x030e), /* Wacom Intuos Pen (S) CTL-480 */
+
+ MAKE_VIDPID(0x09da, 0x054f), /* A4 Tech Co., G7 750 mouse */
+ MAKE_VIDPID(0x09da, 0x1410), /* A4 Tech Co., Ltd Bloody AL9 mouse */
+ MAKE_VIDPID(0x09da, 0x3043), /* A4 Tech Co., Ltd Bloody R8A Gaming Mouse */
+ MAKE_VIDPID(0x09da, 0x31b5), /* A4 Tech Co., Ltd Bloody TL80 Terminator Laser Gaming Mouse */
+ MAKE_VIDPID(0x09da, 0x3997), /* A4 Tech Co., Ltd Bloody RT7 Terminator Wireless */
+ MAKE_VIDPID(0x09da, 0x3f8b), /* A4 Tech Co., Ltd Bloody V8 mouse */
+ MAKE_VIDPID(0x09da, 0x51f4), /* Modecom MC-5006 Keyboard */
+ MAKE_VIDPID(0x09da, 0x5589), /* A4 Tech Co., Ltd Terminator TL9 Laser Gaming Mouse */
+ MAKE_VIDPID(0x09da, 0x7b22), /* A4 Tech Co., Ltd Bloody V5 */
+ MAKE_VIDPID(0x09da, 0x7f2d), /* A4 Tech Co., Ltd Bloody R3 mouse */
+ MAKE_VIDPID(0x09da, 0x8090), /* A4 Tech Co., Ltd X-718BK Oscar Optical Gaming Mouse */
+ MAKE_VIDPID(0x09da, 0x9033), /* A4 Tech Co., X7 X-705K */
+ MAKE_VIDPID(0x09da, 0x9066), /* A4 Tech Co., Sharkoon Fireglider Optical */
+ MAKE_VIDPID(0x09da, 0x9090), /* A4 Tech Co., Ltd XL-730K / XL-750BK / XL-755BK Laser Mouse */
+ MAKE_VIDPID(0x09da, 0x90c0), /* A4 Tech Co., Ltd X7 G800V keyboard */
+ MAKE_VIDPID(0x09da, 0xf012), /* A4 Tech Co., Ltd Bloody V7 mouse */
+ MAKE_VIDPID(0x09da, 0xf32a), /* A4 Tech Co., Ltd Bloody B540 keyboard */
+ MAKE_VIDPID(0x09da, 0xf613), /* A4 Tech Co., Ltd Bloody V2 mouse */
+ MAKE_VIDPID(0x09da, 0xf624), /* A4 Tech Co., Ltd Bloody B120 Keyboard */
+
+ MAKE_VIDPID(0x1b1c, 0x1b3c), /* Corsair Harpoon RGB gaming mouse */
+
+ MAKE_VIDPID(0x1d57, 0xad03), /* [T3] 2.4GHz and IR Air Mouse Remote Control */
+
+ MAKE_VIDPID(0x1e7d, 0x2e4a), /* Roccat Tyon Mouse */
+
+ MAKE_VIDPID(0x20a0, 0x422d), /* Winkeyless.kr Keyboards */
+
+ MAKE_VIDPID(0x2516, 0x001f), /* Cooler Master Storm Mizar Mouse */
+ MAKE_VIDPID(0x2516, 0x0028), /* Cooler Master Storm Alcor Mouse */
+ };
+
+ unsigned int i;
+ Uint32 id;
Uint16 vendor;
Uint16 product;
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL);
+ /* Check the joystick blacklist */
+ id = MAKE_VIDPID(vendor, product);
+ for (i = 0; i < SDL_arraysize(joystick_blacklist); ++i) {
+ if (id == joystick_blacklist[i]) {
+ return SDL_TRUE;
+ }
+ }
+
if (SDL_IsJoystickPS4(vendor, product) && SDL_IsPS4RemapperRunning()) {
return SDL_TRUE;
}
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c
index af331f1..85a7ee5 100644
--- a/src/joystick/linux/SDL_sysjoystick.c
+++ b/src/joystick/linux/SDL_sysjoystick.c
@@ -87,100 +87,7 @@ static int numjoysticks = 0;
static int
IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *guid)
{
- /* This list is taken from:
- https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py
- */
- static Uint32 joystick_blacklist[] = {
- /* Microsoft Microsoft Wireless Optical Desktop® 2.10 */
- /* Microsoft Wireless Desktop - Comfort Edition */
- MAKE_VIDPID(0x045e, 0x009d),
-
- /* Microsoft Microsoft® Digital Media Pro Keyboard */
- /* Microsoft Corp. Digital Media Pro Keyboard */
- MAKE_VIDPID(0x045e, 0x00b0),
-
- /* Microsoft Microsoft® Digital Media Keyboard */
- /* Microsoft Corp. Digital Media Keyboard 1.0A */
- MAKE_VIDPID(0x045e, 0x00b4),
-
- /* Microsoft Microsoft® Digital Media Keyboard 3000 */
- MAKE_VIDPID(0x045e, 0x0730),
-
- /* Microsoft Microsoft® 2.4GHz Transceiver v6.0 */
- /* Microsoft Microsoft® 2.4GHz Transceiver v8.0 */
- /* Microsoft Corp. Nano Transceiver v1.0 for Bluetooth */
- /* Microsoft Wireless Mobile Mouse 1000 */
- /* Microsoft Wireless Desktop 3000 */
- MAKE_VIDPID(0x045e, 0x0745),
-
- /* Microsoft® SideWinder(TM) 2.4GHz Transceiver */
- MAKE_VIDPID(0x045e, 0x0748),
-
- /* Microsoft Corp. Wired Keyboard 600 */
- MAKE_VIDPID(0x045e, 0x0750),
-
- /* Microsoft Corp. Sidewinder X4 keyboard */
- MAKE_VIDPID(0x045e, 0x0768),
-
- /* Microsoft Corp. Arc Touch Mouse Transceiver */
- MAKE_VIDPID(0x045e, 0x0773),
-
- /* Microsoft® 2.4GHz Transceiver v9.0 */
- /* Microsoft® Nano Transceiver v2.1 */
- /* Microsoft Sculpt Ergonomic Keyboard (5KV-00001) */
- MAKE_VIDPID(0x045e, 0x07a5),
-
- /* Microsoft® Nano Transceiver v1.0 */
- /* Microsoft Wireless Keyboard 800 */
- MAKE_VIDPID(0x045e, 0x07b2),
-
- /* Microsoft® Nano Transceiver v2.0 */
- MAKE_VIDPID(0x045e, 0x0800),
-
- /* List of Wacom devices at: http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs */
- MAKE_VIDPID(0x056a, 0x0010), /* Wacom ET-0405 Graphire */
- MAKE_VIDPID(0x056a, 0x0011), /* Wacom ET-0405A Graphire2 (4x5) */
- MAKE_VIDPID(0x056a, 0x0012), /* Wacom ET-0507A Graphire2 (5x7) */
- MAKE_VIDPID(0x056a, 0x0013), /* Wacom CTE-430 Graphire3 (4x5) */
- MAKE_VIDPID(0x056a, 0x0014), /* Wacom CTE-630 Graphire3 (6x8) */
- MAKE_VIDPID(0x056a, 0x0015), /* Wacom CTE-440 Graphire4 (4x5) */
- MAKE_VIDPID(0x056a, 0x0016), /* Wacom CTE-640 Graphire4 (6x8) */
- MAKE_VIDPID(0x056a, 0x0017), /* Wacom CTE-450 Bamboo Fun (4x5) */
- MAKE_VIDPID(0x056a, 0x0016), /* Wacom CTE-640 Graphire 4 6x8 */
- MAKE_VIDPID(0x056a, 0x0017), /* Wacom CTE-450 Bamboo Fun 4x5 */
- MAKE_VIDPID(0x056a, 0x0018), /* Wacom CTE-650 Bamboo Fun 6x8 */
- MAKE_VIDPID(0x056a, 0x0019), /* Wacom CTE-631 Bamboo One */
- MAKE_VIDPID(0x056a, 0x00d1), /* Wacom Bamboo Pen and Touch CTH-460 */
-
- MAKE_VIDPID(0x09da, 0x054f), /* A4 Tech Co., G7 750 mouse */
- MAKE_VIDPID(0x09da, 0x3043), /* A4 Tech Co., Ltd Bloody R8A Gaming Mouse */
- MAKE_VIDPID(0x09da, 0x31b5), /* A4 Tech Co., Ltd Bloody TL80 Terminator Laser Gaming Mouse */
- MAKE_VIDPID(0x09da, 0x3997), /* A4 Tech Co., Ltd Bloody RT7 Terminator Wireless */
- MAKE_VIDPID(0x09da, 0x3f8b), /* A4 Tech Co., Ltd Bloody V8 mouse */
- MAKE_VIDPID(0x09da, 0x51f4), /* Modecom MC-5006 Keyboard */
- MAKE_VIDPID(0x09da, 0x5589), /* A4 Tech Co., Ltd Terminator TL9 Laser Gaming Mouse */
- MAKE_VIDPID(0x09da, 0x7b22), /* A4 Tech Co., Ltd Bloody V5 */
- MAKE_VIDPID(0x09da, 0x7f2d), /* A4 Tech Co., Ltd Bloody R3 mouse */
- MAKE_VIDPID(0x09da, 0x8090), /* A4 Tech Co., Ltd X-718BK Oscar Optical Gaming Mouse */
- MAKE_VIDPID(0x09da, 0x9066), /* A4 Tech Co., Sharkoon Fireglider Optical */
- MAKE_VIDPID(0x09da, 0x9090), /* A4 Tech Co., Ltd XL-730K / XL-750BK / XL-755BK Laser Mouse */
- MAKE_VIDPID(0x09da, 0x90c0), /* A4 Tech Co., Ltd X7 G800V keyboard */
- MAKE_VIDPID(0x09da, 0xf012), /* A4 Tech Co., Ltd Bloody V7 mouse */
- MAKE_VIDPID(0x09da, 0xf32a), /* A4 Tech Co., Ltd Bloody B540 keyboard */
- MAKE_VIDPID(0x09da, 0xf613), /* A4 Tech Co., Ltd Bloody V2 mouse */
- MAKE_VIDPID(0x09da, 0xf624), /* A4 Tech Co., Ltd Bloody B120 Keyboard */
-
- MAKE_VIDPID(0x1d57, 0xad03), /* [T3] 2.4GHz and IR Air Mouse Remote Control */
-
- MAKE_VIDPID(0x1e7d, 0x2e4a), /* Roccat Tyon Mouse */
-
- MAKE_VIDPID(0x20a0, 0x422d), /* Winkeyless.kr Keyboards */
-
- MAKE_VIDPID(0x2516, 0x001f), /* Cooler Master Storm Mizar Mouse */
- MAKE_VIDPID(0x2516, 0x0028), /* Cooler Master Storm Alcor Mouse */
- };
struct input_id inpid;
- int i;
Uint32 id;
Uint16 *guid16 = (Uint16 *)guid->data;
@@ -217,14 +124,6 @@ IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *gui
}
#endif
- /* Check the joystick blacklist */
- id = MAKE_VIDPID(inpid.vendor, inpid.product);
- for (i = 0; i < SDL_arraysize(joystick_blacklist); ++i) {
- if (id == joystick_blacklist[i]) {
- return 0;
- }
- }
-
#ifdef DEBUG_JOYSTICK
printf("Joystick: %s, bustype = %d, vendor = 0x%.4x, product = 0x%.4x, version = %d\n", namebuf, inpid.bustype, inpid.vendor, inpid.product, inpid.version);
#endif