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
0932f4a1
Commit
0932f4a1
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: Get default axes configuration from the device for joydev.
parent
9a73798a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
joystick_linux.c
dlls/dinput/joystick_linux.c
+28
-1
No files found.
dlls/dinput/joystick_linux.c
View file @
0932f4a1
...
...
@@ -79,6 +79,9 @@ struct JoyDev
{
char
device
[
MAX_PATH
];
char
name
[
MAX_PATH
];
BYTE
dev_axes_map
[
ABS_MAX
+
1
];
int
have_axes_map
;
};
typedef
struct
JoystickImpl
JoystickImpl
;
...
...
@@ -133,6 +136,29 @@ static INT find_joystick_devices(void)
WARN
(
"ioctl(%s,JSIOCGNAME) failed: %s
\n
"
,
joydev
.
device
,
strerror
(
errno
));
#endif
if
(
ioctl
(
fd
,
JSIOCGAXMAP
,
joydev
.
dev_axes_map
)
<
0
)
{
WARN
(
"ioctl(%s,JSIOCGNAME) failed: %s
\n
"
,
joydev
.
device
,
strerror
(
errno
));
joydev
.
have_axes_map
=
0
;
}
else
{
INT
j
;
joydev
.
have_axes_map
=
1
;
/* Remap to DI numbers */
for
(
j
=
0
;
j
<
ABS_MAX
;
j
++
)
if
(
joydev
.
dev_axes_map
[
j
]
<
8
)
/* Axis match 1-to-1 */
joydev
.
dev_axes_map
[
j
]
=
j
;
else
if
(
joydev
.
dev_axes_map
[
j
]
==
16
||
joydev
.
dev_axes_map
[
j
]
==
17
)
/* POV axis */
joydev
.
dev_axes_map
[
j
]
=
8
;
else
joydev
.
dev_axes_map
[
j
]
=
-
1
;
}
close
(
fd
);
if
(
!
joystick_devices_count
)
...
...
@@ -296,7 +322,8 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
newDevice
->
generic
.
deadzone
=
0
;
/* do any user specified configuration */
hr
=
setup_dinput_options
(
&
newDevice
->
generic
,
NULL
);
hr
=
setup_dinput_options
(
&
newDevice
->
generic
,
newDevice
->
joydev
->
have_axes_map
?
newDevice
->
joydev
->
dev_axes_map
:
NULL
);
if
(
hr
!=
DI_OK
)
goto
FAILED1
;
...
...
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