Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Commit 5bfba82

Browse files
committed
[ADAPTER] Handle xinput Xbox btn report through mouse report
1 parent a555f12 commit 5bfba82

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

main/adapter/hid_parser.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ static int32_t hid_report_fingerprint(struct hid_report *report) {
183183
}
184184
case 0x39: /* HAT_SWITCH */
185185
return PAD;
186+
case 0x85: /* Sys Main Menu */
187+
return MOUSE; /* Hack for xinput Xbox btn */
186188
}
187189
break;
188190
case USAGE_GEN_KEYBOARD:

main/adapter/wireless/hid_generic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ static void hid_mouse_init(struct hid_report_meta *meta, struct hid_report *repo
251251
map->meta[AXIS_LY].polarity = 1;
252252
map->meta[AXIS_LY].relative = 1;
253253
break;
254+
case 0x85: /* Sys Main Menu */
255+
/* Hack for xinput Xbox btn */
256+
meta->hid_btn_idx = i;
257+
map->mask[0] |= BIT(PAD_MT);
258+
map->btns_mask[PAD_MT] = BIT(0);
259+
break;
254260
}
255261
break;
256262
case USAGE_GEN_BUTTON:

0 commit comments

Comments
 (0)