# SDL: Added libusb hack for Gamesir-G3w which needs the same adjustment as the Hori controllers

**URL:** <https://discourse.libsdl.org/t/sdl-added-libusb-hack-for-gamesir-g3w-which-needs-the-same-adjustment-as-the-hori-controllers/38196>\
**Category:** SDL Commits\
**Created:** [August 13, 2022, 1:22am UTC](https://discourse.libsdl.org/t/sdl-added-libusb-hack-for-gamesir-g3w-which-needs-the-same-adjustment-as-the-hori-controllers/38196 "2022-08-13T01:22:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [August 13, 2022, 1:22am UTC](https://discourse.libsdl.org/t/sdl-added-libusb-hack-for-gamesir-g3w-which-needs-the-same-adjustment-as-the-hori-controllers/38196/1 "2022-08-13T01:22:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/b880709e9c30cf26c7ba85ac4446b937c3f98410>

```diff
From b880709e9c30cf26c7ba85ac4446b937c3f98410 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 12 Aug 2022 18:11:27 -0700
Subject: [PATCH] Added libusb hack for Gamesir-G3w which needs the same
 adjustment as the Hori controllers

---
 src/hidapi/libusb/hid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c
index d2c407c965b..dbcd4fa3bdf 100644
--- a/src/hidapi/libusb/hid.c
+++ b/src/hidapi/libusb/hid.c
@@ -1087,7 +1087,8 @@ static int SDLCALL read_thread(void *param)
 
 static void init_xbox360(libusb_device_handle *device_handle, unsigned short idVendor, unsigned short idProduct, struct libusb_config_descriptor *conf_desc)
 {
-	if (idVendor == 0x0f0d && idProduct == 0x00dc) {
+	if ((idVendor == 0x05ac && idProduct == 0x055b) /* Gamesir-G3w */ ||
+ (idVendor == 0x0f0d && idProduct == 0x00dc) /* HORIPAD */) {
 		unsigned char data[20];
 
 		/* The HORIPAD FPS for Nintendo Switch requires this to enable input reports.

```
