Commit Graph

111 Commits

Author SHA1 Message Date
Rémi Bernon 45986545f8 dinput: Write PID device gain reports when necessary.
Based on a patch from Ivo Ivanov <logos128@gmail.com>.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:26:09 +01:00
Rémi Bernon e7217a3287 dinput: Stub support for the DIPROP_FFGAIN property.
Based on a patch from Ivo Ivanov <logos128@gmail.com>.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:25:33 +01:00
Rémi Bernon e6eb909d21 dinput: Stub support for DIPROP_AUTOCENTER property.
Signed-off-by: Ivo Ivanov <logos128@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-16 10:08:44 +01:00
Rémi Bernon f0cd5c5c3c dinput: Move device data format to struct dinput_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-29 12:29:58 +02:00
Rémi Bernon 4e56801abd dinput: Rewrite and simplify user data format object matching.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-29 12:29:54 +02:00
Rémi Bernon 621af39c11 dinput: Use user object data format array to keep user offsets.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-29 12:29:49 +02:00
Rémi Bernon f82cce060d dinput: Always use the data format transform.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-28 13:03:57 +02:00
Rémi Bernon 8847de46ec dinput: Move user data format to struct dinput_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-28 13:03:51 +02:00
Rémi Bernon dac2e0b187 dinput: Rename IDirectInputDeviceImpl to struct dinput_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:49 +02:00
Rémi Bernon b242273482 dinput: Factor all IDirectInputDevice8W vtables together.
And remove "internal" suffix from internal functions.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-22 10:18:30 +02:00
Rémi Bernon df08662f84 dinput: Move EnumCreatedEffectObjects checks to device.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-21 11:21:35 +02:00
Rémi Bernon 45d4c253de dinput: Move SendForceFeedbackCommand generic code to device.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-21 11:21:32 +02:00
Rémi Bernon 7c4e91f63b dinput: Move CreateEffect generic implementation to device.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-21 11:21:29 +02:00
Rémi Bernon f54210590f dinput: Use the internal vtable for GetEffectInfo.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-21 11:21:21 +02:00
Rémi Bernon 7ccf07ae8f dinput: Add a release callback for internal refcount handling.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 16:16:07 +02:00
Rémi Bernon 89c59e77c1 dinput: Factor all GetDeviceState implementations together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 16:16:07 +02:00
Rémi Bernon aebd03f070 dinput: Factor all Poll implementations together.
With a new internal poll callback for mouse and keyboard Wine-specific
message peeking behavior.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 16:16:07 +02:00
Rémi Bernon 47a821400a dinput: Factor all SetProperty implementations together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-19 10:50:22 +02:00
Rémi Bernon 3ec4ae8390 dinput: Factor all GetProperty implementations together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-19 10:50:13 +02:00
Rémi Bernon 34f66a0cec dinput: Implement EnumObjects through the internal vtable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 16:03:32 +02:00
Rémi Bernon be9a36c4ff dinput: Introduce new direct_input_device_init helper.
To initialize the device data format by enumerating its objects.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 16:03:30 +02:00
Rémi Bernon 77f5edda30 dinput: Factor all (Un)Acquire implementations together.
And introduce new internal acquire / unacquire callbacks.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Rémi Bernon 18981330c5 dinput: Factor all SetActionMap wrappers together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Rémi Bernon 30ea1876db dinput: Factor all BuildActionMap wrappers together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Rémi Bernon daed18a816 dinput: Factor all GetCapabilities implementations together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Rémi Bernon fc7f430afb dinput: Factor all GetDeviceInfo implementations together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Rémi Bernon adfee25b45 dinput: Remove legacy joystick backends.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 10:58:29 +02:00
Rémi Bernon 7011685e1e dinput: Move PIDVID internal guid to device.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 10:58:10 +02:00
Rémi Bernon 46d3521120 dinput: Move device_instance_is_disabled to device.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 10:58:03 +02:00
Rémi Bernon df0e491cb1 dinput: Don't disable HID joysticks by default.
Although not completely correct it should be usable already, and running
the tests would require setting the registry key before and cleaning it
up after otherwise.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:21 +02:00
Rémi Bernon b36c6ae0e8 dinput: Add read event and callback for file-based devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 20:25:05 +02:00
Rémi Bernon f3a07c5cae dinput: Factor out IDirectInputDevice ansi vtable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:53:07 +02:00
Rémi Bernon 8d7914962b dinput: Introduce direct_input_device_alloc helper.
To factor out device allocation and initialization.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:53:07 +02:00
Rémi Bernon 5f4ee79149 dinput: Factor out IDirectInputDevice_SetActionMap WtoA conversions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 16:14:24 +02:00
Rémi Bernon 8109f8398a dinput: Factor out IDirectInputDevice_BuildActionMap WtoA conversions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 16:14:19 +02:00
Rémi Bernon 27ea33baf9 dinput: Factor out IDirectInputDevice_GetDeviceInfo WtoA conversions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 16:14:13 +02:00
Rémi Bernon 7713050c77 dinput: Factor out IDirectInputDevice_GetDeviceState WtoA conversions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 16:14:08 +02:00
Rémi Bernon 5eb5f94fc0 dinput: Factor out IDirectInputDevice_GetCapabilities WtoA conversions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 16:14:03 +02:00
Rémi Bernon 5fe103107a dinput: Use IDirectInputDevice8W interface consistently.
Instead of sometimes using IDirectInputDevice8A.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:01 +02:00
Rémi Bernon 225be12999 dinput8: Add support for rawinput based devices.
This adds a message window that will be used as the rawinput target
window for WM_INPUT messages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 21:17:15 +02:00
Rémi Bernon 306c40e673 dinput: Use dedicated list for mouse and keyboard.
Instead of using function pointer, which is also not very CPU friendly.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 21:23:33 +02:00
Rémi Bernon 26c1131201 dinput: Use a single list for all acquired devices.
Instead of going through devices list of dinputs list, and checking
their acquired field, which is not CPU friendly.

This also removes the now unused IDirectInputImpl critical section and
devices list.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 21:23:33 +02:00
Alistair Leslie-Hughes 8d05256172 dinput: Cap the buffer size to 20.
When a program calls SetProperty with DIPROP_BUFFERSIZE, dinput records
this value for GetProperty but only uses it when the device can support
that number of buffers otherwise a max value.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45732
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-13 19:41:02 +01:00
Brendan Shanks d2d3959d3d dinput: Add "PIDVID" guidProduct and use for non-keyboards/mice.
Windows uses an undocumented GUID (ending in ASCII "PIDVID") for
non-keyboard/mouse devices. Various games (DiRT Rally 2) and libraries
(SDL, GLFW) look for this GUID to match specific devices or know that
the PID/VID can be extracted.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-20 21:29:37 +02:00
Brendan McGrath 3a2834b3a4 dinput: Use the same GUID for Instance and Product.
Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-31 17:22:36 +01:00
Jetro Jormalainen 967399eba0 dinput: Keep username same between device objects.
Signed-off-by: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-03 20:43:39 +01:00
Bernhard Übelacker fbc85ddc28 dinput: Implement device property DIPROP_USERNAME.
Signed-off-by: Bernhard Übelacker <bernhardu@vr-web.de>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-31 15:57:32 +09:00
Francois Gouget 128a86f0b0 dinput: IDirectInputDevice8WImpl_SetActionMap() is redundant so remove it. 2015-03-02 13:50:27 +09:00
Francois Gouget 1e8abc3984 dinput: Make semantic_to_obj_id() static. 2011-09-02 14:42:14 +02:00
Lucas Fialho Zawacki d175c1526f dinput: Common implementation for joystick, keyboard and mouse SetActionMap. 2011-08-24 11:51:42 +02:00