Commit Graph

50 Commits

Author SHA1 Message Date
Rémi Bernon d272fc76c1 winebus.sys: Add HID haptics simple controllers for the triggers.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-15 12:48:11 +01:00
Rémi Bernon ecc881f731 winebus.sys: Remove the now unused HID haptics combined waveform report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 18:31:01 +01:00
Rémi Bernon e651f56e79 winebus.sys: Declare multiple HID simple haptics controller collections.
Instead of having the waveforms combined. This better matches what
Windows.Gaming.Input and Windows.Devices.Haptics are exposing, with one
SimpleHapticsController for each motor.

This will also simplify the declaration of left/right trigger motors.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 18:30:47 +01:00
Rémi Bernon 99ef287bb7 winebus.sys: Don't reset report descriptor when starting a collection.
Fixes regression introduced in 1200e9d472,
incorrectly split from hid_device_begin_report_descriptor.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 21:48:49 +01:00
Rémi Bernon 1200e9d472 winebus.sys: Use a physical collection for the HID input report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 21:31:51 +01:00
Rémi Bernon e4105a71d1 winebus.sys: Pass USAGE_AND_PAGE to hid_device_begin_report_descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 21:31:48 +01:00
Rémi Bernon 2f41101b95 winebus.sys: Link the first two absolute axes to the effect directions.
And use the same usages as for the axes themselves instead of generic
HID usages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 20:04:05 +01:00
Rémi Bernon 389b962f2a winebus.sys: Use a local variable to access hid_device_state.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 20:04:00 +01:00
Francois Gouget 26ff79c37d winebus.sys: Make hid_device_get_report_descriptor() static.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Rémi Bernon b65a76de53 winebus.sys: Add a repeat count value to haptics output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-15 22:59:53 +01:00
Rémi Bernon c2c730a330 winebus.sys: Pack the HID haptics waveform report struct.
And only keep previously set waveform intensity in the device state.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-15 22:59:53 +01:00
Rémi Bernon 7c93adbdd5 winebus.sys: Use a separate hid_device_vtbl function to stop haptics.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-15 22:59:53 +01:00
Rémi Bernon baa417a371 winebus.sys: Fix HID haptics waveform NONE / STOP ordinals.
There's some inconsistencies between the HID 1.22 specification and
HID usage names in Windows SDK headers. The headers use STOP for the
0x1001 usage name, and NULL for 0x1002, where the HID spec uses None for
the 0x1001 usage name and Stop for 0x1002.

Both are implicit waveforms anyway, and the HID usages aren't really
used anywhere, but their ordinal matters. The HID spec says that None
has ordinal 1, and Stop ordinal 2, and that Stop waveform can be used
to stop any previously started waveform. We are going to stick to that
and ignore the HID usages, although the names won't match the usages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:42 +01:00
Rémi Bernon 3bb0e2e5e5 winebus.sys: Fix warnings with long integer types.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:54 +01:00
Rémi Bernon 4b1f9daad5 winebus.sys: Use an unsigned 16bit range for saturation and deadband values.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51922
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Rémi Bernon 3ed121bffa winebus.sys: Send PID effect state reports for SDL devices.
Checking for effect state updates periodically, as well as whenever the
device state changes but not more than once every 10ms.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52062
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Rémi Bernon c42933f5ec winebus.sys: Add a PID effect state input report.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52062
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Ivo Ivanov 31a668439b winebus.sys: Support arbitrary effect parameter updates.
DInput will only send the output reports that have been modified, we
need to support sparse effect updates.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52061
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Rémi Bernon fca0f18d08 winebus.sys: Avoid unnecessary scaling of effect parameter values.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:31:38 +01:00
Rémi Bernon b2ba9737ad winebus.sys: Remove effect gain from the crafted PID reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:31:38 +01:00
Ivo Ivanov dfaf7e0490 winebus.sys: Add PID_USAGE_PARAMETER_BLOCK_OFFSET in the set condition report.
Fixes improper interpretation of the condition output reports.

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-19 18:31:38 +01:00
Rémi Bernon fd47d58e8c winebus.sys: Add a PID device gain output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:25:51 +01:00
Rémi Bernon 5b735572c1 winebus.sys: Use +hid debug channel.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 11:16:55 +01:00
Rémi Bernon 1c4523a9d4 winebus.sys: Add a PID set ramp force output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 4a2db9f29e winebus.sys: Add a PID set constant force output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon c263fea14f winebus.sys: Add a PID set condition output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 4b653ae043 winebus.sys: Add a PID set envelope output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 6f2e66963c winebus.sys: Add a PID set periodic output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 12d91995fd winebus.sys: Add a PID effect update output report.
Advertising support of the periodic effect types only for now.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:19 +02:00
Rémi Bernon 3b3228e9c7 winebus.sys: Add a PID effect control output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:01:56 +02:00
Rémi Bernon 903c7ea75d winebus.sys: Add a PID device control output report.
And include it in the HID report descriptor when SDL device has support
for any haptic effect, or when UDEV lnxev device has any FF bit set.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:17 +02:00
Rémi Bernon e42f11d7a2 winebus.sys: Remove old vendor rumble report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon cb4d378fa9 winebus.sys: Add a new rumble report using HID haptics.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon 78f67d5c08 winebus.sys: Handle feature and output reports in hid_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:45 +02:00
Rémi Bernon 04b19a969b winebus.sys: Use report ids in crafted HID reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:39 +02:00
Rémi Bernon 9cf1e8353c winebus.sys: Factor out setting HID report values.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:33 +02:00
Rémi Bernon c6df23fed3 winebus.sys: Factor out HID report buffers allocation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:21 +02:00
Rémi Bernon 9d5e9b5f42 winebus.sys: Use the computed element offsets to create reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:10 +02:00
Rémi Bernon de050c974b winebus.sys: Compute offsets while building the report descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:07 +02:00
Rémi Bernon fa3905bafa winebus.sys: Introduce a new raw_device / hid_device abstraction.
For any device which requires building HID reports.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:02 +02:00
Rémi Bernon 8221229498 winebus.sys: Always add padding after button blocks.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:58 +02:00
Rémi Bernon 593c4d5149 winebus.sys: Move hats before buttons and use one byte each.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:54 +02:00
Rémi Bernon d7c4867257 winebus.sys: Enforce all axis values to be 32bit.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:43 +02:00
Rémi Bernon 8f6932fd35 winebus.sys: Avoid process heap allocations on the unix side.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:41 +02:00
Rémi Bernon e54ff70e5d winebus.sys: Build with msvcrt.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:38 +02:00
Rémi Bernon 35a6148acf winebus.sys: Use Rtl heap functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:37 +02:00
Rémi Bernon 5e0c1ce443 winebus.sys: Move mouse and keyboard devices to unixlib.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 6ae7e808bd winebus.sys: Use HID descriptor helpers in bus_sdl.c.
And remove old helpers.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 40e445572a winebus.sys: Use HID descriptor helpers in bus_udev.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 2ea19ff357 winebus.sys: Introduce new HID report descriptor helpers.
And use them for mouse and keyboard.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00