Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Thrustmaster Hotas X axis order #251

Open
wants to merge 1 commit into
base: bleeding-edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion dlls/winebus.sys/bus_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ static const USAGE_AND_PAGE g920_absolute_usages[] =
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Z}, /* brake */
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_RZ}, /* clutch */
};
static const USAGE_AND_PAGE hotas_x_absolute_usages[] =
{
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X},
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Y},
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Z}, /* throttle */
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_RZ}, /* yaw */
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_SLIDER}, /* throttle rocker */
};
static const USAGE_AND_PAGE absolute_axis_usages[] =
{
{.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X},
Expand All @@ -281,11 +289,18 @@ static const USAGE_AND_PAGE relative_axis_usages[] =

static int get_absolute_usages(struct sdl_device *impl, const USAGE_AND_PAGE **absolute_usages)
{
if (is_logitech_g920(pSDL_JoystickGetVendor(impl->sdl_joystick), pSDL_JoystickGetProduct(impl->sdl_joystick)))
int vid = pSDL_JoystickGetVendor(impl->sdl_joystick);
int pid = pSDL_JoystickGetProduct(impl->sdl_joystick);
if (is_logitech_g920(vid, pid))
{
*absolute_usages = g920_absolute_usages;
return ARRAY_SIZE(g920_absolute_usages);
}
if (is_thrustmaster_hotas_x(vid, pid))
{
*absolute_usages = hotas_x_absolute_usages;
return ARRAY_SIZE(hotas_x_absolute_usages);
}

*absolute_usages = absolute_axis_usages;
return ARRAY_SIZE(absolute_axis_usages);
Expand Down
1 change: 1 addition & 0 deletions dlls/winebus.sys/unix_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ BOOL is_wine_blacklisted(WORD vid, WORD pid);
BOOL is_dualshock4_gamepad(WORD vid, WORD pid);
BOOL is_dualsense_gamepad(WORD vid, WORD pid);
BOOL is_logitech_g920(WORD vid, WORD pid);
BOOL is_thrustmaster_hotas_x(WORD vid, WORD pid);
BOOL is_hidraw_enabled(WORD vid, WORD pid, INT axes, INT buttons);

#endif /* __WINEBUS_UNIX_PRIVATE_H */
7 changes: 6 additions & 1 deletion dlls/winebus.sys/unixlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ BOOL is_logitech_g920(WORD vid, WORD pid)
return vid == 0x046D && pid == 0xC262;
}

BOOL is_thrustmaster_hotas_x(WORD vid, WORD pid)
{
return vid == 0x044F && pid == 0xB108;
}

static BOOL is_thrustmaster_hotas(WORD vid, WORD pid)
{
return vid == 0x044F && (pid == 0xB679 || pid == 0xB687 || pid == 0xB10A);
return vid == 0x044F && (pid == 0xB679 || pid == 0xB687 || pid == 0xB10A || pid == 0xB108);
}

static BOOL is_simucube_wheel(WORD vid, WORD pid)
Expand Down