[PATCH 1/4] winebus.sys: Add a function to check if the device is a Sony DualSense gamepad.

Rémi Bernon rbernon at codeweavers.com
Fri Jan 21 16:44:52 CST 2022


Hi Arek,

On 1/21/22 17:10, Arkadiusz Hiler wrote:
> Signed-off-by: Arkadiusz Hiler <ahiler at codeweavers.com>
> ---
>   dlls/winebus.sys/unix_private.h | 1 +
>   dlls/winebus.sys/unixlib.c      | 6 ++++++
>   2 files changed, 7 insertions(+)
> 
> diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h
> index efecf6cdbe3..e897251dea8 100644
> --- a/dlls/winebus.sys/unix_private.h
> +++ b/dlls/winebus.sys/unix_private.h
> @@ -266,5 +266,6 @@ extern void hid_device_set_effect_state(struct unix_device *iface, BYTE index, B
>   
>   BOOL is_xbox_gamepad(WORD vid, WORD pid) DECLSPEC_HIDDEN;
>   BOOL is_dualshock4_gamepad(WORD vid, WORD pid) DECLSPEC_HIDDEN;
> +BOOL is_dualsense_gamepad(WORD vid, WORD pid) DECLSPEC_HIDDEN;
>   
>   #endif /* __WINEBUS_UNIX_PRIVATE_H */
> diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c
> index 1269ae05c2b..3a7c3a16428 100644
> --- a/dlls/winebus.sys/unixlib.c
> +++ b/dlls/winebus.sys/unixlib.c
> @@ -70,6 +70,12 @@ BOOL is_dualshock4_gamepad(WORD vid, WORD pid)
>       return FALSE;
>   }
>   
> +BOOL is_dualsense_gamepad(WORD vid, WORD pid)
> +{
> +    if (vid == 0x054c && pid == 0x0ce6) return TRUE;
> +    return FALSE;
> +}
> +
>   struct mouse_device
>   {
>       struct unix_device unix_device;

I think this should be merged into the next patch so that we don't add 
code that's not used yet.
-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list