From d4112edb7130700fb09902537be91490ebedcf14 Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Fri, 1 Sep 2023 05:12:21 +0200 Subject: [PATCH] winebus.sys: Enable hidraw for Virpil Constellation ALPHA-R. Fixes: https://github.com/ValveSoftware/Proton/issues/6839 --- dlls/winebus.sys/unixlib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index 32c1f9a00d9f..1e08f4a1eadf 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -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"); @@ -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;