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
055b67ea
Commit
055b67ea
authored
Dec 23, 2022
by
Tim Clem
Committed by
Alexandre Julliard
Jan 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Add granularity to object_properties.
Return WHEEL_DELTA for the granularity of the mouse z-axis. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53627
parent
1e6258d2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
2 deletions
+10
-2
device.c
dlls/dinput/device.c
+2
-1
device_private.h
dlls/dinput/device_private.h
+1
-0
joystick_hid.c
dlls/dinput/joystick_hid.c
+1
-0
mouse.c
dlls/dinput/mouse.c
+6
-0
device8.c
dlls/dinput/tests/device8.c
+0
-1
No files found.
dlls/dinput/device.c
View file @
055b67ea
...
@@ -1103,6 +1103,7 @@ static BOOL CALLBACK get_object_property( const DIDEVICEOBJECTINSTANCEW *instanc
...
@@ -1103,6 +1103,7 @@ static BOOL CALLBACK get_object_property( const DIDEVICEOBJECTINSTANCEW *instanc
{
{
.
range_min
=
DIPROPRANGE_NOMIN
,
.
range_min
=
DIPROPRANGE_NOMIN
,
.
range_max
=
DIPROPRANGE_NOMAX
,
.
range_max
=
DIPROPRANGE_NOMAX
,
.
granularity
=
1
,
};
};
struct
get_object_property_params
*
params
=
context
;
struct
get_object_property_params
*
params
=
context
;
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
params
->
iface
);
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
params
->
iface
);
...
@@ -1155,7 +1156,7 @@ static BOOL CALLBACK get_object_property( const DIDEVICEOBJECTINSTANCEW *instanc
...
@@ -1155,7 +1156,7 @@ static BOOL CALLBACK get_object_property( const DIDEVICEOBJECTINSTANCEW *instanc
case
(
DWORD_PTR
)
DIPROP_GRANULARITY
:
case
(
DWORD_PTR
)
DIPROP_GRANULARITY
:
{
{
DIPROPDWORD
*
value
=
(
DIPROPDWORD
*
)
params
->
header
;
DIPROPDWORD
*
value
=
(
DIPROPDWORD
*
)
params
->
header
;
value
->
dwData
=
1
;
value
->
dwData
=
properties
->
granularity
;
return
DIENUM_STOP
;
return
DIENUM_STOP
;
}
}
case
(
DWORD_PTR
)
DIPROP_KEYNAME
:
case
(
DWORD_PTR
)
DIPROP_KEYNAME
:
...
...
dlls/dinput/device_private.h
View file @
055b67ea
...
@@ -67,6 +67,7 @@ struct object_properties
...
@@ -67,6 +67,7 @@ struct object_properties
LONG
deadzone
;
LONG
deadzone
;
LONG
saturation
;
LONG
saturation
;
DWORD
calibration_mode
;
DWORD
calibration_mode
;
DWORD
granularity
;
};
};
enum
device_status
enum
device_status
...
...
dlls/dinput/joystick_hid.c
View file @
055b67ea
...
@@ -1696,6 +1696,7 @@ static BOOL init_object_properties( struct hid_joystick *impl, struct hid_value_
...
@@ -1696,6 +1696,7 @@ static BOOL init_object_properties( struct hid_joystick *impl, struct hid_value_
}
}
properties
->
saturation
=
10000
;
properties
->
saturation
=
10000
;
properties
->
granularity
=
1
;
return
DIENUM_CONTINUE
;
return
DIENUM_CONTINUE
;
}
}
...
...
dlls/dinput/mouse.c
View file @
055b67ea
...
@@ -99,6 +99,12 @@ static BOOL CALLBACK init_object_properties( const DIDEVICEOBJECTINSTANCEW *inst
...
@@ -99,6 +99,12 @@ static BOOL CALLBACK init_object_properties( const DIDEVICEOBJECTINSTANCEW *inst
properties
->
range_min
=
DIPROPRANGE_NOMIN
;
properties
->
range_min
=
DIPROPRANGE_NOMIN
;
properties
->
range_max
=
DIPROPRANGE_NOMAX
;
properties
->
range_max
=
DIPROPRANGE_NOMAX
;
/* The z-axis (wheel) has a different granularity */
if
(
instance
->
dwOfs
==
DIMOFS_Z
)
properties
->
granularity
=
WHEEL_DELTA
;
else
properties
->
granularity
=
1
;
return
DIENUM_CONTINUE
;
return
DIENUM_CONTINUE
;
}
}
...
...
dlls/dinput/tests/device8.c
View file @
055b67ea
...
@@ -1823,7 +1823,6 @@ static void test_sys_mouse( DWORD version )
...
@@ -1823,7 +1823,6 @@ static void test_sys_mouse( DWORD version )
prop_dword
.
dwData
=
0xdeadbeef
;
prop_dword
.
dwData
=
0xdeadbeef
;
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_GRANULARITY
,
&
prop_dword
.
diph
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_GRANULARITY
,
&
prop_dword
.
diph
);
ok
(
hr
==
DI_OK
,
"GetProperty DIPROP_GRANULARITY returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DI_OK
,
"GetProperty DIPROP_GRANULARITY returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_dword
.
dwData
==
WHEEL_DELTA
,
"got %ld expected %ld
\n
"
,
prop_dword
.
dwData
,
(
DWORD
)
WHEEL_DELTA
);
ok
(
prop_dword
.
dwData
==
WHEEL_DELTA
,
"got %ld expected %ld
\n
"
,
prop_dword
.
dwData
,
(
DWORD
)
WHEEL_DELTA
);
prop_range
.
lMin
=
0xdeadbeef
;
prop_range
.
lMin
=
0xdeadbeef
;
prop_range
.
lMax
=
0xdeadbeef
;
prop_range
.
lMax
=
0xdeadbeef
;
...
...
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