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
2941cc72
Commit
2941cc72
authored
Aug 15, 2009
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Aug 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Set default joystick axes mapping for evdev.
parent
fa9c11da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+8
-3
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
2941cc72
...
...
@@ -378,6 +378,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
JoystickImpl
*
newDevice
;
LPDIDATAFORMAT
df
=
NULL
;
int
i
,
idx
=
0
;
BYTE
default_axis_map
[
WINE_JOYSTICK_MAX_AXES
+
WINE_JOYSTICK_MAX_POVS
*
2
];
newDevice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
JoystickImpl
));
if
(
!
newDevice
)
return
NULL
;
...
...
@@ -411,6 +412,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
newDevice
->
dev_axes_to_di
[
i
]
=
idx
;
newDevice
->
generic
.
props
[
idx
].
lDevMin
=
newDevice
->
joydev
->
axes
[
i
].
minimum
;
newDevice
->
generic
.
props
[
idx
].
lDevMax
=
newDevice
->
joydev
->
axes
[
i
].
maximum
;
default_axis_map
[
idx
]
=
i
;
idx
++
;
}
else
...
...
@@ -424,16 +426,19 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
{
newDevice
->
generic
.
device_axis_count
+=
2
;
newDevice
->
generic
.
props
[
idx
].
lDevMin
=
newDevice
->
joydev
->
axes
[
ABS_HAT0X
+
i
*
2
].
minimum
;
newDevice
->
dev_axes_to_di
[
ABS_HAT0X
+
i
*
2
]
=
idx
++
;
newDevice
->
dev_axes_to_di
[
ABS_HAT0X
+
i
*
2
]
=
idx
;
newDevice
->
generic
.
props
[
idx
].
lDevMax
=
newDevice
->
joydev
->
axes
[
ABS_HAT0Y
+
i
*
2
].
maximum
;
newDevice
->
dev_axes_to_di
[
ABS_HAT0Y
+
i
*
2
]
=
idx
++
;
newDevice
->
dev_axes_to_di
[
ABS_HAT0Y
+
i
*
2
]
=
idx
+
1
;
default_axis_map
[
idx
]
=
default_axis_map
[
idx
+
1
]
=
WINE_JOYSTICK_MAX_AXES
+
i
;
idx
+=
2
;
}
else
newDevice
->
dev_axes_to_di
[
ABS_HAT0X
+
i
*
2
]
=
newDevice
->
dev_axes_to_di
[
ABS_HAT0Y
+
i
*
2
]
=
-
1
;
}
/* do any user specified configuration */
if
(
setup_dinput_options
(
&
newDevice
->
generic
,
NULL
)
!=
DI_OK
)
goto
failed
;
if
(
setup_dinput_options
(
&
newDevice
->
generic
,
default_axis_map
)
!=
DI_OK
)
goto
failed
;
/* Create copy of default data format */
if
(
!
(
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
c_dfDIJoystick2
.
dwSize
)))
goto
failed
;
...
...
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