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
ac3668a0
Commit
ac3668a0
authored
Sep 24, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Sep 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Make default dead zone configurable.
parent
8ff85c08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+26
-10
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
ac3668a0
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winerror.h"
#include "winerror.h"
#include "winreg.h"
#include "dinput.h"
#include "dinput.h"
#include "dinput_private.h"
#include "dinput_private.h"
...
@@ -391,21 +392,35 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
...
@@ -391,21 +392,35 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
JoystickImpl
*
newDevice
;
JoystickImpl
*
newDevice
;
LPDIDATAFORMAT
df
=
NULL
;
LPDIDATAFORMAT
df
=
NULL
;
int
i
,
idx
=
0
;
int
i
,
idx
=
0
;
char
buffer
[
MAX_PATH
+
16
];
HKEY
hkey
,
appkey
;
LONG
def_deadzone
=
-
1
;
newDevice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
JoystickImpl
));
newDevice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
JoystickImpl
));
if
(
!
newDevice
)
return
NULL
;
if
(
!
newDevice
)
return
NULL
;
newDevice
->
base
.
lpVtbl
=
jvt
;
newDevice
->
base
.
lpVtbl
=
jvt
;
newDevice
->
base
.
ref
=
1
;
newDevice
->
base
.
ref
=
1
;
memcpy
(
&
newDevice
->
base
.
guid
,
rguid
,
sizeof
(
*
rguid
));
newDevice
->
base
.
guid
=
*
rguid
;
InitializeCriticalSection
(
&
newDevice
->
base
.
crit
);
newDevice
->
base
.
dinput
=
dinput
;
newDevice
->
base
.
crit
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": JoystickImpl*->base.crit"
);
newDevice
->
joyfd
=
-
1
;
newDevice
->
joyfd
=
-
1
;
newDevice
->
joydev
=
&
joydevs
[
index
];
newDevice
->
base
.
dinput
=
dinput
;
newDevice
->
joydev
=
&
joydevs
[
index
];
#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION
#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION
newDevice
->
ff_state
=
FF_STATUS_STOPPED
;
newDevice
->
ff_state
=
FF_STATUS_STOPPED
;
#endif
#endif
InitializeCriticalSection
(
&
newDevice
->
base
.
crit
);
newDevice
->
base
.
crit
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": JoystickImpl*->base.crit"
);
/* get options */
get_app_key
(
&
hkey
,
&
appkey
);
if
(
!
get_config_key
(
hkey
,
appkey
,
"DefaultDeadZone"
,
buffer
,
MAX_PATH
))
{
def_deadzone
=
atoi
(
buffer
);
TRACE
(
"setting default deadzone to: %d
\n
"
,
def_deadzone
);
}
if
(
appkey
)
RegCloseKey
(
appkey
);
if
(
hkey
)
RegCloseKey
(
hkey
);
/* Create copy of default data format */
/* Create copy of default data format */
if
(
!
(
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
c_dfDIJoystick2
.
dwSize
)))
goto
failed
;
if
(
!
(
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
c_dfDIJoystick2
.
dwSize
)))
goto
failed
;
...
@@ -427,7 +442,8 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
...
@@ -427,7 +442,8 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
newDevice
->
props
[
idx
].
lMin
=
0
;
newDevice
->
props
[
idx
].
lMin
=
0
;
newDevice
->
props
[
idx
].
lMax
=
0xffff
;
newDevice
->
props
[
idx
].
lMax
=
0xffff
;
newDevice
->
props
[
idx
].
lSaturation
=
0
;
newDevice
->
props
[
idx
].
lSaturation
=
0
;
newDevice
->
props
[
idx
].
lDeadZone
=
MulDiv
(
newDevice
->
joydev
->
axes
[
i
].
flat
,
0xffff
,
newDevice
->
props
[
idx
].
lDeadZone
=
def_deadzone
>=
0
?
def_deadzone
:
MulDiv
(
newDevice
->
joydev
->
axes
[
i
].
flat
,
0xffff
,
newDevice
->
props
[
idx
].
lDevMax
-
newDevice
->
props
[
idx
].
lDevMin
);
newDevice
->
props
[
idx
].
lDevMax
-
newDevice
->
props
[
idx
].
lDevMin
);
df
->
rgodf
[
idx
++
].
dwType
=
DIDFT_MAKEINSTANCE
(
newDevice
->
numAxes
++
)
|
DIDFT_ABSAXIS
;
df
->
rgodf
[
idx
++
].
dwType
=
DIDFT_MAKEINSTANCE
(
newDevice
->
numAxes
++
)
|
DIDFT_ABSAXIS
;
...
...
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