Skip to content

Commit

Permalink
winebus.sys: Enable hidraw for VKB Gladiator NXT EVO.
Browse files Browse the repository at this point in the history
These devices ship with 128 buttons by default. For game compatibility,
the VKB Windows app can be used to change the HID descriptor to show
only 32 buttons and have up to 4 virtual devices instead. These devices
can also show up as a mouse or keyboard and send proper HID events for
that configuration - not tested with this commit.

The Linux input layer gets really confused by these devices as the
HID descriptor spans multiple ranges of different device type event
codes. Hopefully, winebus.sys hidraw mode can work around this. Also
needs udev rules to enable hidraw access.

Known limits:
- Elite Dangerous: 32 buttons
- Star Citizen: 50 buttons
- some other games: 64 buttons

Signed-off-by: Kai Krakow <[email protected]>
  • Loading branch information
kakra committed Sep 2, 2023
1 parent 52380ca commit f6641c7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dlls/winebus.sys/unixlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ static BOOL is_fanatec_pedals(WORD vid, WORD pid)
return FALSE;
}

static BOOL is_vkb_controller(WORD vid, WORD pid, INT buttons)
{
if (vid != 0x231D) return FALSE;

/* comes with 128 buttons in the default configuration */
if (buttons == 128) return TRUE;

/* if customized, less than 128 buttons may be shown, decide by PID */
if (pid == 0x0200) return TRUE; /* VKBsim Gladiator EVO Right Grip */
if (pid == 0x0201) return TRUE; /* VKBsim Gladiator EVO Left Grip */
return FALSE;
}

BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons)
{
const char *enabled = getenv("PROTON_ENABLE_HIDRAW");
Expand All @@ -115,6 +128,7 @@ BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons)
if (is_thrustmaster_hotas(vid, pid)) return TRUE;
if (is_simucube_wheel(vid, pid)) return TRUE;
if (is_fanatec_pedals(vid, pid)) return TRUE;
if (is_vkb_controller(vid, pid, buttons)) return TRUE;

sprintf(needle, "0x%04x/0x%04x", vid, pid);
if (enabled) return strcasestr(enabled, needle) != NULL;
Expand Down

0 comments on commit f6641c7

Please sign in to comment.