Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
39589188
Commit
39589188
authored
Jul 11, 2005
by
Francois Gouget
Committed by
Alexandre Julliard
Jul 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only print the joystick state when it changes so the user does not get
300 lines of traces.
parent
d7589706
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
joystick.c
dlls/dinput/tests/joystick.c
+9
-1
No files found.
dlls/dinput/tests/joystick.c
View file @
39589188
...
...
@@ -23,6 +23,7 @@
#include <windows.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "wine/test.h"
...
...
@@ -138,6 +139,7 @@ static BOOL CALLBACK EnumJoysticks(
DIDEVICEINSTANCE
inst
;
DIDEVICEINSTANCE_DX3
inst3
;
HWND
hWnd
=
get_hwnd
();
char
oldstate
[
248
],
curstate
[
248
];
ok
(
data
->
version
>
0x0300
,
"Joysticks not supported in version 0x%04lx
\n
"
,
data
->
version
);
...
...
@@ -261,13 +263,14 @@ static BOOL CALLBACK EnumJoysticks(
count
=
1
;
trace
(
"
\n
"
);
oldstate
[
0
]
=
'\0'
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
hr
=
IDirectInputDevice_GetDeviceState
(
pJoystick
,
sizeof
(
DIJOYSTATE2
),
&
js
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice_GetDeviceState() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
if
(
hr
!=
DI_OK
)
break
;
trace
(
"X%5ld Y%5ld Z%5ld Rx%5ld Ry%5ld Rz%5ld "
sprintf
(
curstate
,
"X%5ld Y%5ld Z%5ld Rx%5ld Ry%5ld Rz%5ld "
"S0%5ld S1%5ld POV0%5ld POV1%5ld POV2%5ld POV3%5ld "
"B %d %d %d %d %d %d %d %d %d %d %d %d
\n
"
,
js
.
lX
,
js
.
lY
,
js
.
lZ
,
js
.
lRx
,
js
.
lRy
,
js
.
lRz
,
...
...
@@ -277,6 +280,11 @@ static BOOL CALLBACK EnumJoysticks(
js
.
rgbButtons
[
3
]
>>
7
,
js
.
rgbButtons
[
4
]
>>
7
,
js
.
rgbButtons
[
5
]
>>
7
,
js
.
rgbButtons
[
6
]
>>
7
,
js
.
rgbButtons
[
7
]
>>
7
,
js
.
rgbButtons
[
8
]
>>
7
,
js
.
rgbButtons
[
9
]
>>
7
,
js
.
rgbButtons
[
10
]
>>
7
,
js
.
rgbButtons
[
11
]
>>
7
);
if
(
strcmp
(
oldstate
,
curstate
)
!=
0
)
{
trace
(
curstate
);
strcpy
(
oldstate
,
curstate
);
}
Sleep
(
100
);
}
trace
(
"
\n
"
);
...
...
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