Commit Graph

907 Commits (master)

Author SHA1 Message Date
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
Rémi Bernon 9463684d55 dinput: Stop sending WM_WINE_NOTIFY_ACTIVITY on every input.
This message triggers screensaver notification in the user drivers, but
it is not useful to send it on every input message, and it even hurts
performance when high polling mouse is used.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33643
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46976
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
Brendan Shanks 1832dc3df3 dinput: Fix IDirectInputEffect::SetParameters() when called with flags=0.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:15:30 +02:00
Brendan Shanks 23a55927af dinput/tests: Test IDirectInputEffect::SetParameters() with a zeroed DIEFFECT and flags=0.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:15:28 +02:00
Brendan Shanks cf40880c69 dinput: Fix crash in dump_DIEFFECT() when lpvTypeSpecificParams is unexpectedly NULL.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:15:26 +02:00
Brendan Shanks f65cfbfe9b dinput: Fix DInput8 keyboard behavior for injected events with scancode=0.
Grand Theft Auto IV injects VK_F8 and scancode=0, and expects DirectInput not
to report that F8 is pressed.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-21 22:54:26 +02:00
Brendan Shanks d5fd3c8a38 dinput: Block Acquire() until hooks are installed to prevent input being lost.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-21 22:54:26 +02:00
Brendan Shanks f66517b5a2 dinput: Fix IDirectInputEffect::SetParameters() behavior with NULL effect parameters.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 09:23:30 +01:00
Brendan Shanks f00b59f597 dinput/tests: Test IDirectInputEffect::SetParameters() with NULL effect parameters.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 09:23:28 +01:00
Brendan Shanks f925becd4a dinput: Fix crash in dump_DIEFFECT() when rglDirection is unexpectedly NULL.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-25 20:58:47 +01:00
Rémi Bernon 50440e28bb dinput: Increase device buffer size to 1024.
The buffer size was previously limited to 20 in:

  8d05256172

Testing shows that it is somewhere around 1024 on Windows, and using a
smaller buffer causes some input data to be lost with high polling rate
mouses. It can be spotted in Wolfenstein II: New Colossus menus.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-17 18:49:59 +01:00
Jacek Caban 3ad95e03b8 makedep: Link importlib object files into module only when it's explicitly imported.
To prevent msvcrt linking its own importlib into DLL.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-23 21:11:29 +01:00
Andrew Eikum b58a6ce7c5 dinput: Add missing ASPECT flags to c_dfDIJoystick.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-21 20:58:01 +01:00
Andrew Eikum e2e100272f dinput: Add missing ASPECT flags for c_dfDIJoystick2.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-21 20:57:56 +01:00
Andrew Eikum af2f419426 dinput: Fix V/A/FSlider dwOfs values in c_dfDIJoystick2.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-21 20:57:52 +01: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
Bernat Arlandis 5d07cdf54f dinput: Log effect directions, and use effective flags.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-11 21:51:28 +01:00
Alistair Leslie-Hughes d61d710121 dinput: Mouse device doesn't support property DIPROP_VIDPID.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-11 12:48:11 +01:00
Alistair Leslie-Hughes f10f98cfa2 dinput: Keyboard device doesn't support property DIPROP_VIDPID.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-11 12:48:08 +01:00
Alistair Leslie-Hughes 1dfc36c379 dinput: Detect more buttons as non-joysticks.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:27 +02:00
Alistair Leslie-Hughes 61a85a6031 dinput/tests: Remove unrequired pointer checks (Coverity).
Also fixes a few test strings.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-21 17:11:43 +02:00
Alistair Leslie-Hughes db07ff83b3 dinput: Don't treat Stylus devices as joysticks.
Tablet/Stylus devices have a js* entry which we are
treating as a joystick.  Any testbox VM that is configured
with a tablet is currently failing the joystick tests.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-09 16:14:38 +02:00
Alistair Leslie-Hughes 0555209757 dinput/tests: Add checks for Acquire/Unacquire.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-08 10:57:50 +02:00
Rémi Bernon d7916cdf4f dinput/tests: Add test to validate interactions between dinput and raw input devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-27 21:54:47 +02: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 Shanks 50785992d0 dinput/tests: Test for correct guidProduct.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-20 21:29:37 +02:00
Alistair Leslie-Hughes 55edfc8837 dinput: Ensure buffer doesn't overflow (Coverity).
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 21:34:04 +02:00
Alexey Prokhin 1235ad1932 dinput/tests: Check path format of DIPROP_GUIDANDPATH property.
Signed-off-by: Alexey Prokhin <alexey@prokhin.ru>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 20:25:40 +02:00
Alexey Prokhin e2465fdb0a dinput/tests: Remove todo from DIPROP_GUIDANDPATH test.
Signed-off-by: Alexey Prokhin <alexey@prokhin.ru>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 20:25:38 +02:00
Alexey Prokhin f55ce610b2 dinput: Return fake DIPROP_GUIDANDPATH property for OSX joysticks.
Signed-off-by: Alexey Prokhin <alexey@prokhin.ru>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 20:25:35 +02:00
Alexey Prokhin 2bcdf8b73b dinput: Return fake DIPROP_GUIDANDPATH property for linux input joysticks.
Signed-off-by: Alexey Prokhin <alexey@prokhin.ru>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 20:25:33 +02:00
Alexey Prokhin 16a11d0c90 dinput: Return fake DIPROP_GUIDANDPATH property for linux joysticks.
Some Ubisoft titles use the property to check if a dinput gamepad is
also an xinput device.

Signed-off-by: Alexey Prokhin <alexey@prokhin.ru>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 20:25:29 +02:00
Alistair Leslie-Hughes dba4428b6d dinput: Trace reference count in a consistent way.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 12:25:25 +02:00
Alistair Leslie-Hughes e29effc633 dinput: Return correct value in IDirectInputDevice2 Release.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 12:25:02 +02:00
Aric Stewart c5283300e1 dinput: Handle case where IOHIDDeviceGetValue fails.
This prevents crashes if a controller disconnects from OS/X.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-04 23:05:26 +02:00
Tim Schumacher 5d51d8a25e dinput/linuxinput: Remap wheel axes to X, Y, and Z.
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-03 22:33:30 +02:00
Tim Schumacher 66462cb7dc dinput: Check for wheel axes/buttons when finding joysticks.
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-31 21:31:34 +02:00
Alistair Leslie-Hughes 87a8622ffe dinput/tests: Remove unrequired if (Coverity).
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-27 14:39:34 +02:00
Alistair Leslie-Hughes ab5d9e43cb dinput: Support DIDEVICEINSTANCE_DX3 for keyboard GetDeviceInfo.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-21 18:08:37 +02:00
Alistair Leslie-Hughes c4debff5db dinput: Improve returned flags in Mouse GetObjectInfo.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-17 20:42:22 +02:00
Alexandre Julliard 1d399dba61 dinput/tests: Remove duplicate const.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:37:34 +02:00
Alexandre Julliard d5a372abbb include: Move inline assembly definitions to a new wine/asm.h header.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 13:45:07 +02:00
Alistair Leslie-Hughes 132cf25ed6 dinput: Handle setting DIPROP_CALIBRATIONMODE mode in generic implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47183
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 10:29:22 +02:00
Alistair Leslie-Hughes fe4db5309e dinput: Allow enumeration of joysticks with DirectX 3.
Star Wars: Rogue 3D requests a DirectX 3.0 version
0108:trace:dinput:DirectInputCreateEx (0x400000,0300,{9a4cb684-236d-11d3-8e9d-00c04f6844ae},0x7acfa0,(nil))
and then tries to interate over all Joysticks.

When using modern windows, the current tests show that this is the correct behaviour.

However, it's possible to use a shim to allow older games, like the
one above, to interate over joysticks.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-13 13:29:43 +02:00
Alistair Leslie-Hughes 9bcaf9769c dinput: Ensure Cursor is visible on config dialog.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 11:39:58 -05:00
Alistair Leslie-Hughes 52deca4900 dinput: Trace This pointer in a consistent way.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 11:39:52 -05:00
Andrew Eikum ae84957916 dinput: Use heuristics to guess if a device is a gamepad or a joystick.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47123
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 09:21:21 -05:00
Alistair Leslie-Hughes 1daeef7332 dinput: Use a helper function to get device type.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 09:15:34 -05:00
Alistair Leslie-Hughes 381fa00b6a dinput: Support DIDEVICEINSTANCE_DX3 for Mouse GetDeviceInfo.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 07:13:53 -05:00