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
5c18aa58
Commit
5c18aa58
authored
Sep 23, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Report HID joystick wheel usage as a Z axis.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b61a2728
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
19 deletions
+9
-19
joystick_hid.c
dlls/dinput/joystick_hid.c
+3
-0
hid.c
dlls/dinput8/tests/hid.c
+6
-19
No files found.
dlls/dinput/joystick_hid.c
View file @
5c18aa58
...
...
@@ -178,6 +178,7 @@ static const GUID *object_usage_to_guid( USAGE usage_page, USAGE usage )
case
HID_USAGE_GENERIC_X
:
return
&
GUID_XAxis
;
case
HID_USAGE_GENERIC_Y
:
return
&
GUID_YAxis
;
case
HID_USAGE_GENERIC_Z
:
return
&
GUID_ZAxis
;
case
HID_USAGE_GENERIC_WHEEL
:
return
&
GUID_ZAxis
;
case
HID_USAGE_GENERIC_RX
:
return
&
GUID_RxAxis
;
case
HID_USAGE_GENERIC_RY
:
return
&
GUID_RyAxis
;
case
HID_USAGE_GENERIC_RZ
:
return
&
GUID_RzAxis
;
...
...
@@ -274,6 +275,7 @@ static BOOL enum_value_objects( struct hid_joystick *impl, const DIPROPHEADER *f
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
break
;
case
HID_USAGE_GENERIC_Z
:
case
HID_USAGE_GENERIC_WHEEL
:
instance
.
dwOfs
=
DIJOFS_Z
;
set_axis_type
(
&
instance
,
seen_axis
,
2
,
&
axis
);
instance
.
dwFlags
=
DIDOI_ASPECTPOSITION
;
...
...
@@ -301,6 +303,7 @@ static BOOL enum_value_objects( struct hid_joystick *impl, const DIPROPHEADER *f
ret
=
enum_object
(
impl
,
filter
,
flags
,
callback
,
&
caps
,
&
instance
,
data
);
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
break
;
case
HID_USAGE_GENERIC_DIAL
:
case
HID_USAGE_GENERIC_SLIDER
:
instance
.
dwOfs
=
DIJOFS_SLIDER
(
0
);
instance
.
dwType
=
DIDFT_ABSAXIS
|
DIDFT_MAKEINSTANCE
(
6
+
axis
++
);
...
...
dlls/dinput8/tests/hid.c
View file @
5c18aa58
...
...
@@ -3286,14 +3286,9 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c
struct
check_objects_todos
{
BOOL
guid
;
BOOL
ofs
;
BOOL
type
;
BOOL
flags
;
BOOL
collection_number
;
BOOL
usage
;
BOOL
usage_page
;
BOOL
report_id
;
};
struct
check_objects_params
...
...
@@ -3317,13 +3312,11 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
if
(
params
->
index
>=
params
->
expect_count
)
exp
=
&
unexpected_obj
;
check_member
(
*
obj
,
*
exp
,
"%u"
,
dwSize
);
todo_wine_if
(
todo
->
guid
)
check_member_guid
(
*
obj
,
*
exp
,
guidType
);
todo_wine_if
(
todo
->
ofs
)
check_member
(
*
obj
,
*
exp
,
"%#x"
,
dwOfs
);
todo_wine_if
(
todo
->
type
)
check_member
(
*
obj
,
*
exp
,
"%#x"
,
dwType
);
todo_wine_if
(
todo
->
flags
)
check_member
(
*
obj
,
*
exp
,
"%#x"
,
dwFlags
);
if
(
!
localized
)
todo_wine
check_member_wstr
(
*
obj
,
*
exp
,
tszName
);
check_member
(
*
obj
,
*
exp
,
"%u"
,
dwFFMaxForce
);
...
...
@@ -3331,13 +3324,10 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
todo_wine_if
(
todo
->
collection_number
)
check_member
(
*
obj
,
*
exp
,
"%u"
,
wCollectionNumber
);
check_member
(
*
obj
,
*
exp
,
"%u"
,
wDesignatorIndex
);
todo_wine_if
(
todo
->
usage_page
)
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
wUsagePage
);
todo_wine_if
(
todo
->
usage
)
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
wUsage
);
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
dwDimension
);
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
wExponent
);
todo_wine_if
(
todo
->
report_id
)
check_member
(
*
obj
,
*
exp
,
"%u"
,
wReportId
);
winetest_pop_context
();
...
...
@@ -3593,11 +3583,10 @@ static void test_simple_joystick(void)
{
{.
ofs
=
TRUE
},
{.
ofs
=
TRUE
},
{.
guid
=
TRUE
,
.
ofs
=
TRUE
,
.
type
=
TRUE
,
.
flags
=
TRUE
,
.
usage
=
TRUE
},
{.
guid
=
TRUE
,
.
ofs
=
TRUE
,
.
type
=
TRUE
,
.
usage
=
TRUE
,
.
usage_page
=
TRUE
},
{.
ofs
=
TRUE
,
.
type
=
TRUE
,
.
usage
=
TRUE
},
{.
guid
=
TRUE
,
.
ofs
=
TRUE
,
.
type
=
TRUE
,
.
collection_number
=
TRUE
,
.
report_id
=
TRUE
,
.
usage
=
TRUE
,
.
usage_page
=
TRUE
},
{.
type
=
TRUE
},
{.
ofs
=
TRUE
},
{.
ofs
=
TRUE
},
{.
ofs
=
TRUE
},
{.
ofs
=
TRUE
},
};
struct
check_objects_params
check_objects_params
=
...
...
@@ -3794,7 +3783,6 @@ static void test_simple_joystick(void)
check_member
(
caps
,
expect_caps
,
"%d"
,
dwSize
);
check_member
(
caps
,
expect_caps
,
"%#x"
,
dwFlags
);
check_member
(
caps
,
expect_caps
,
"%#x"
,
dwDevType
);
todo_wine
check_member
(
caps
,
expect_caps
,
"%d"
,
dwAxes
);
check_member
(
caps
,
expect_caps
,
"%d"
,
dwButtons
);
check_member
(
caps
,
expect_caps
,
"%d"
,
dwPOVs
);
...
...
@@ -3960,11 +3948,9 @@ static void test_simple_joystick(void)
res
=
0
;
hr
=
IDirectInputDevice8_EnumObjects
(
device
,
check_object_count
,
&
res
,
DIDFT_AXIS
|
DIDFT_PSHBUTTON
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_EnumObjects returned %#x
\n
"
,
hr
);
todo_wine
ok
(
res
==
5
,
"got %u expected %u
\n
"
,
res
,
5
);
hr
=
IDirectInputDevice8_EnumObjects
(
device
,
check_objects
,
&
check_objects_params
,
DIDFT_ALL
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_EnumObjects returned %#x
\n
"
,
hr
);
todo_wine
ok
(
check_objects_params
.
index
>=
check_objects_params
.
expect_count
,
"missing %u objects
\n
"
,
check_objects_params
.
expect_count
-
check_objects_params
.
index
);
...
...
@@ -4616,7 +4602,7 @@ static void test_simple_joystick(void)
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lX
);
todo_wine
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lY
);
todo_wine
_if
(
i
==
1
)
todo_wine
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lZ
);
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lRx
);
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
rgdwPOV
[
0
]
);
...
...
@@ -4641,6 +4627,7 @@ static void test_simple_joystick(void)
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lX
);
todo_wine
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lY
);
todo_wine
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lZ
);
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
lRx
);
check_member
(
state
,
expect_state_rel
[
i
],
"%d"
,
rgdwPOV
[
0
]
);
...
...
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