Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
42c8860b
Commit
42c8860b
authored
Mar 03, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Check collection nodes to find HID simulation device usages.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6efb4071
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
joystick_hid.c
dlls/dinput/joystick_hid.c
+15
-0
No files found.
dlls/dinput/joystick_hid.c
View file @
42c8860b
...
...
@@ -1418,10 +1418,12 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND
{
BOOL
has_accelerator
,
has_brake
,
has_clutch
,
has_z
,
has_pov
;
PHIDP_PREPARSED_DATA
preparsed_data
=
NULL
;
HIDP_LINK_COLLECTION_NODE
nodes
[
256
];
DWORD
type
,
button_count
=
0
;
HIDP_BUTTON_CAPS
buttons
[
10
];
HIDP_VALUE_CAPS
value
;
HANDLE
device_file
;
ULONG
node_count
;
NTSTATUS
status
;
USHORT
count
;
...
...
@@ -1453,6 +1455,16 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND
instance
->
wUsagePage
=
caps
->
UsagePage
;
instance
->
wUsage
=
caps
->
Usage
;
node_count
=
ARRAY_SIZE
(
nodes
);
status
=
HidP_GetLinkCollectionNodes
(
nodes
,
&
node_count
,
preparsed_data
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
node_count
=
0
;
while
(
node_count
--
)
{
if
(
nodes
[
node_count
].
LinkUsagePage
!=
HID_USAGE_PAGE_SIMULATION
)
continue
;
if
(
nodes
[
node_count
].
LinkUsage
==
HID_USAGE_SIMULATION_AUTOMOBILE_SIMULATION_DEVICE
)
type
=
DI8DEVTYPE_DRIVING
;
if
(
nodes
[
node_count
].
LinkUsage
==
HID_USAGE_SIMULATION_FLIGHT_SIMULATION_DEVICE
)
type
=
DI8DEVTYPE_FLIGHT
;
}
count
=
ARRAY_SIZE
(
buttons
);
status
=
HidP_GetSpecificButtonCaps
(
HidP_Output
,
HID_USAGE_PAGE_PID
,
0
,
PID_USAGE_DC_DEVICE_RESET
,
buttons
,
&
count
,
preparsed_data
);
...
...
@@ -1533,6 +1545,9 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND
else
type
|=
(
DI8DEVTYPEDRIVING_LIMITED
<<
8
);
break
;
case
DI8DEVTYPE_FLIGHT
:
type
|=
(
DI8DEVTYPEFLIGHT_STICK
<<
8
);
break
;
}
instance
->
dwDevType
=
device_type_for_version
(
type
,
version
)
|
DIDEVTYPE_HID
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment