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
4bc1e172
Commit
4bc1e172
authored
Mar 06, 2018
by
Johann Frei
Committed by
Alexandre Julliard
Mar 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
>
parent
0c58f0ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
mouse.c
dlls/dinput/mouse.c
+15
-2
mouse.c
dlls/dinput/tests/mouse.c
+22
-1
No files found.
dlls/dinput/mouse.c
View file @
4bc1e172
...
...
@@ -616,8 +616,21 @@ static HRESULT WINAPI SysMouseWImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REF
case
(
DWORD_PTR
)
DIPROP_GRANULARITY
:
{
LPDIPROPDWORD
pr
=
(
LPDIPROPDWORD
)
pdiph
;
/* We'll just assume that the app asks about the Z axis */
pr
->
dwData
=
WHEEL_DELTA
;
if
(
((
pdiph
->
dwHow
==
DIPH_BYOFFSET
)
&&
((
pdiph
->
dwObj
==
DIMOFS_X
)
||
(
pdiph
->
dwObj
==
DIMOFS_Y
)))
||
((
pdiph
->
dwHow
==
DIPH_BYID
)
&&
((
pdiph
->
dwObj
==
(
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_X_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
))
||
(
pdiph
->
dwObj
==
(
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Y_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
))))
){
/* Set granularity of X/Y Axis to 1. See MSDN on DIPROP_GRANULARITY */
pr
->
dwData
=
1
;
}
else
{
/* We'll just assume that the app asks about the Z axis */
pr
->
dwData
=
WHEEL_DELTA
;
}
break
;
}
...
...
dlls/dinput/tests/mouse.c
View file @
4bc1e172
...
...
@@ -161,7 +161,7 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd)
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
S_OK
&&
cnt
>
0
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
cnt
);
/* Check for buffer o
w
erflow */
/* Check for buffer o
v
erflow */
for
(
i
=
0
;
i
<
6
;
i
++
)
mouse_event
(
MOUSEEVENTF_MOVE
,
10
+
i
,
10
+
i
,
0
,
0
);
...
...
@@ -172,6 +172,27 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd)
hr
=
IDirectInputDevice_GetDeviceData
(
pMouse
,
sizeof
(
mouse_state
),
&
mouse_state
,
&
cnt
,
0
);
ok
(
hr
==
DI_OK
&&
cnt
==
1
,
"GetDeviceData() failed: %08x cnt:%d
\n
"
,
hr
,
cnt
);
/* Check for granularity property using BYOFFSET */
memset
(
&
di_op
,
0
,
sizeof
(
di_op
));
di_op
.
diph
.
dwHow
=
DIPH_BYOFFSET
;
di_op
.
diph
.
dwObj
=
DIMOFS_Y
;
di_op
.
diph
.
dwSize
=
sizeof
(
DIPROPDWORD
);
di_op
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
);
hr
=
IDirectInputDevice_GetProperty
(
pMouse
,
DIPROP_GRANULARITY
,
&
di_op
.
diph
);
/* Granularity of Y axis should be 1! */
ok
(
hr
==
S_OK
&&
di_op
.
dwData
==
1
,
"GetProperty(): %08x, dwData: %i but should be 1.
\n
"
,
hr
,
di_op
.
dwData
);
/* Check for granularity property using BYID */
memset
(
&
di_op
,
0
,
sizeof
(
di_op
));
di_op
.
diph
.
dwHow
=
DIPH_BYID
;
/* WINE_MOUSE_Y_AXIS_INSTANCE := 1 */
di_op
.
diph
.
dwObj
=
(
DIDFT_MAKEINSTANCE
(
1
)
|
DIDFT_RELAXIS
);
di_op
.
diph
.
dwSize
=
sizeof
(
DIPROPDWORD
);
di_op
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
);
hr
=
IDirectInputDevice_GetProperty
(
pMouse
,
DIPROP_GRANULARITY
,
&
di_op
.
diph
);
/* Granularity of Y axis should be 1! */
ok
(
hr
==
S_OK
&&
di_op
.
dwData
==
1
,
"GetProperty(): %08x, dwData: %i but should be 1.
\n
"
,
hr
,
di_op
.
dwData
);
if
(
pMouse
)
IUnknown_Release
(
pMouse
);
DestroyWindow
(
hwnd2
);
...
...
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