Commit Graph

821 Commits

Author SHA1 Message Date
Dmitry Timoshkov 210cefd23d dinput/tests: Add some tests for DIK_ codes using different keyboard layouts.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-17 17:03:13 +02:00
Dmitry Timoshkov d341b0a86b dinput: The DIK_ key code should match the scan code.
This reverts commit 304ff3c728.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-17 17:03:13 +02:00
Johann Frei 4bc1e172ec dinput: Implement X/Y axis granularity and add test.
Signed-off-by: Johann Frei <johann_frei@yahoo.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-08 11:27:19 -06:00
Bob Ziuchkovski 221708d64e dinput: Ignore vendor-specific usage pages for joystick elements on Mac.
Signed-off-by: Bob Ziuchkovski <bob.ziuchkovski@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-09 21:34:50 +01:00
Zebediah Figura 51895145fd dinput/tests: Don't pump messages in test_acquire().
This causes intermittent failures due to implementation of our window drivers.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-06 11:13:16 +01:00
Zebediah Figura 58abb3518c dinput/tests: Remove a no longer needed workaround.
This was fixed by 41ce4a0158.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-06 10:55:16 +01:00
Fabian Maurer 49fdde1cdd dinput: Use proper size for combobox controls.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-31 18:55:33 +02:00
Bruno Jesus b50d1fa314 dinput: Limit axes while remaping broken devices.
Signed-off-by: Bruno Jesus <bjesus@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-13 20:56:19 +02:00
Bruno Jesus e87ccb8b05 dinput: Assume a 1-to-1 axes map when no axes match.
The wiimote is a well known problematic device, mainly because it is not
a joystick. It is a USB device. But the classic controller is at least
advertised as a joystick with 6 axes and 11 buttons (js driver only, NO
event).

Signed-off-by: Bruno Jesus <bjesus@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-10 21:51:40 +02:00
Jetro Jormalainen 41b126b5fc dinput: Handle username in EnumDevicesBySemantics.
EnumDevicesBySemantics enums only devices with given username when
DIEDBSFL_THISUSER is set and only unowned devices when
DIEDBSFL_AVAILABLEDEVICES is set.

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
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
Sebastian Lackner f9b4be5556 dinput: Allocate correct amount of memory in IDirectInput8AImpl_EnumDevicesBySemantics.
Fixes 04bddb6c93.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-13 18:50:13 +01:00
Jetro Jormalainen 04bddb6c93 dinput: Give correct count of devices still to be enumerated.
EnumDevicesBySemantics should give count of all devices instead of
just keyboard and mouse still to be enumerated when calling callback.

Signed-off-by: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-09 19:38:07 +01:00
Bruno Jesus 5e59d093a2 dinput/tests: Add tests for DISFFC_STOPALL, DISFFC_RESET and GetEffectStatus.
Requires a FF-enabled joystick to test.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 13:05:44 +01:00
Bruno Jesus 8339de07ca dinput: Simplify JoystickWImpl_Unacquire for Linux.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 13:05:40 +01:00
Bruno Jesus 27f456844b dinput: DISFFC_RESET will not release the effects.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 13:05:36 +01:00
Bruno Jesus 2d2d833248 dinput: Downgrade a FIXME to WARN in JoystickWImpl_SendForceFeedbackCommand.
All valid commands are already there, anything else is an app bug.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 13:05:28 +01:00
Bruno Jesus cc373223b0 dinput: Fix GetEffectStatus for Linux when effect was not downloaded.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 13:05:23 +01:00
Bruno Jesus 6bb2c4cded dinput: Skip events that are not useful currently.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-26 11:14:38 +01:00
Francois Gouget 49d42619fe dinput: Spelling and case fixes in comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-10 19:19:15 +01:00
Bruno Jesus ab5ad7dc0b dinput: Improve linux effect debugging.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-14 22:24:13 +09:00
Bruno Jesus 5ab0126f1d dinput: Fix phase conversion on periodic effects.
Based on idea by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-14 22:24:08 +09:00
Sebastian Lackner 2a5f05e316 dinput: Use variable of correct type to store HRESULT value.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-13 22:41:03 +09:00
Bruno Jesus 80fca2d86d dinput: Remove trailing space from debug string.
Spotted by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-13 12:47:57 +09:00
Bruno Jesus 0d17228ff9 dinput: Handle NULL effect envelope before testing its parameters.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-13 12:47:55 +09:00
Bruno Jesus f85e7d1716 dinput: Only complain for unsupported effect envelope if it really is useful.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-07 10:41:00 +09:00
Bruno Jesus 7027e9b268 dinput: Fix saturation range on condition effects.
Based on ideas by Elias Vanderstuyft.

The saturation is unsigned short, so the limit is 0xffff, not 0x7fff.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-26 10:40:06 +09:00
Bruno Jesus 4712c65f5b dinput: Simplify condition effect translation.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-26 10:40:02 +09:00
Bruno Jesus 4cf2ad9899 dinput: Don't give up if we can't translate the effect envelope.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 13:29:45 +09:00
Bruno Jesus 79b5883fce dinput: Simplify cartesian and fix polar direction calculations.
Based on formulas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 13:29:37 +09:00
Bruno Jesus d0070935e4 dinput: Fix infinite effect length handling.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 13:29:28 +09:00
Bruno Jesus 7d88a12dc0 dinput: Fix calculation of too small periods for periodic effect.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 13:29:16 +09:00
Bruno Jesus 777ca90601 dinput: Dump the condition effect correctly for 2 array items.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-24 12:06:35 +09:00
Bruno Jesus 97b5862e48 dinput/tests: Use EnumEffects and test a supported effect.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-24 12:06:28 +09:00
Bruno Jesus 4d816bdbcd dinput: Restore effect ID on error due to kernel < 3.14 bug.
Based on ideas by Elias Vanderstuyft

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-23 12:18:08 +09:00
Bruno Jesus 327897992b dinput: Do not read/write past the struct for old DX versions.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-23 12:17:57 +09:00
Bruno Jesus 844a25ab38 dinput: Be more precise when returning effect upload errors.
Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-23 12:17:51 +09:00
Bruno Jesus c7e6b4fbec dinput: Dump the force feedback effect before upload.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-23 12:17:38 +09:00
Nikolay Sivov 3605cde8ea dinput: Explicitly check for -1 as open() failure code.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-23 12:17:26 +09:00
Bruno Jesus 6b44c4f5cc dinput: Get the controller type from the device instance for Linux drivers.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-22 12:40:58 +09:00
Bruno Jesus 4cc193bba5 dinput: Dump the DIOBJECTDATAFORMAT flags.
Useful to check if the controller is asking for a specifc
DIDOI_POSITION* type axis.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-22 12:40:46 +09:00
Bruno Jesus f051de0d37 dinput: Return the correct error when CreateEffect is not supported.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-22 12:40:34 +09:00
Bruno Jesus e8273ae497 dinput: Cope with NULL flags in LinuxInputEffectImpl_GetEffectStatus.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-19 16:14:30 +09:00
Bruno Jesus 44303b6625 dinput: Implement DIPROP_PRODUCTNAME in GetProperty.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-19 16:14:30 +09:00
Bruno Jesus 299a6ce5bb dinput: Use the correct index to remap the axis.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-18 20:38:12 +09:00
Bruno Jesus 4f545cb627 dinput: Properly debug DIDEVTYPE_HID in _dump_DIDEVCAPS.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-18 14:02:05 +09:00
Bruno Jesus 30ae735425 dinput: Properly fill the HID information for the controller in the event driver.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-18 12:00:33 +09:00
Bruno Jesus dd7b65730d dinput: Implement GetDeviceInfo(A) using the W version in the event driver.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-18 12:00:31 +09:00
Bruno Jesus 738e17b2d7 dinput: Properly fill the HID information for the controller in the js driver.
Even the Xbox 360 controller which does not use HID has the same flags
and usage page set on Windows.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:17:54 +09:00
Bruno Jesus cfd3076c31 dinput: Implement GetDeviceInfo(A) using the W version in the js driver.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:17:54 +09:00