Skip to content

Commit

Permalink
Use Xbox 360 gamepad USB ids
Browse files Browse the repository at this point in the history
Use the vendorId and productId of an Xbox 360 controller for better
support (the HID gamepad protocol used in scrcpy is similar to that of
the Xbox 360 controller).

Fixes #5362 <#5362>
PR #5623 <#5623>
  • Loading branch information
rom1v committed Dec 8, 2024
1 parent 27a5934 commit 0a09518
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/uhid/gamepad_uhid.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
/** Downcast gamepad processor to sc_gamepad_uhid */
#define DOWNCAST(GP) container_of(GP, struct sc_gamepad_uhid, gamepad_processor)

#define SC_GAMEPAD_UHID_VENDOR_ID 0
#define SC_GAMEPAD_UHID_PRODUCT_ID 0
// Xbox 360
#define SC_GAMEPAD_UHID_VENDOR_ID UINT16_C(0x045e)
#define SC_GAMEPAD_UHID_PRODUCT_ID UINT16_C(0x028e)

static void
sc_gamepad_uhid_send_input(struct sc_gamepad_uhid *gamepad,
Expand Down

0 comments on commit 0a09518

Please sign in to comment.