Skip to content

Commit

Permalink
winebus.sys: Enable hidraw for Virpil Constellation ALPHA-R.
Browse files Browse the repository at this point in the history
  • Loading branch information
kakra committed Oct 3, 2023
1 parent d0ce7e8 commit d324c52
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dlls/winebus.sys/unixlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ static BOOL is_vkb_controller(WORD vid, WORD pid, INT buttons)
return FALSE;
}

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

/* comes with 31 buttons in the default configuration, or 128 max */
if ((buttons == 31) || (buttons == 128)) return TRUE;

/* if customized, arbitrary amount of buttons may be shown, decide by PID */
if (pid == 0x412f) return TRUE; /* Virpil Constellation ALPHA-R */
return FALSE;
}

BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons)
{
const char *enabled = getenv("PROTON_ENABLE_HIDRAW");
Expand All @@ -129,6 +141,7 @@ BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons)
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;
if (is_virpil_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 d324c52

Please sign in to comment.