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
6cb230dd
Commit
6cb230dd
authored
Jul 22, 2005
by
Daniel Remenak
Committed by
Alexandre Julliard
Jul 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct dinput handling of sliders and non-zero-based axes through the
linux input system.
parent
b9efc4d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+19
-1
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
6cb230dd
...
...
@@ -468,7 +468,9 @@ map_axis(JoystickImpl* This, int axis, int val) {
if
(
xmin
==
xmax
)
return
val
;
/* map the value from the hmin-hmax range into the wmin-wmax range */
ret
=
(
val
*
(
wmax
-
wmin
))
/
(
hmax
-
hmin
)
+
wmin
;
ret
=
((
val
-
hmin
)
*
(
wmax
-
wmin
))
/
(
hmax
-
hmin
)
+
wmin
;
TRACE
(
"xmin=%d xmax=%d hmin=%d hmax=%d wmin=%d wmax=%d val=%d ret=%d
\n
"
,
xmin
,
xmax
,
hmin
,
hmax
,
wmin
,
wmax
,
val
,
ret
);
#if 0
/* deadzone doesn't work comfortably enough right now. needs more testing*/
...
...
@@ -492,6 +494,8 @@ static void fake_current_js_state(JoystickImpl *ji)
ji
->
js
.
lRx
=
map_axis
(
ji
,
ABS_RX
,
ji
->
axes
[
ABS_RX
][
AXE_ABS
]);
ji
->
js
.
lRy
=
map_axis
(
ji
,
ABS_RY
,
ji
->
axes
[
ABS_RY
][
AXE_ABS
]);
ji
->
js
.
lRz
=
map_axis
(
ji
,
ABS_RZ
,
ji
->
axes
[
ABS_RZ
][
AXE_ABS
]);
ji
->
js
.
rglSlider
[
0
]
=
map_axis
(
ji
,
ABS_THROTTLE
,
ji
->
axes
[
ABS_THROTTLE
][
AXE_ABS
]);
ji
->
js
.
rglSlider
[
1
]
=
map_axis
(
ji
,
ABS_RUDDER
,
ji
->
axes
[
ABS_RUDDER
][
AXE_ABS
]);
}
static
void
joy_polldev
(
JoystickImpl
*
This
)
{
...
...
@@ -613,6 +617,14 @@ static void joy_polldev(JoystickImpl *This) {
This
->
js
.
lRz
=
map_axis
(
This
,
ABS_RZ
,
ie
.
value
);
GEN_EVENT
(
DIJOFS_RZ
,
This
->
js
.
lRz
,
ie
.
time
.
tv_usec
,(
This
->
dinput
->
evsequence
)
++
);
break
;
case
ABS_THROTTLE
:
This
->
js
.
rglSlider
[
0
]
=
map_axis
(
This
,
ABS_THROTTLE
,
ie
.
value
);
GEN_EVENT
(
DIJOFS_SLIDER
(
0
),
This
->
js
.
rglSlider
[
0
],
ie
.
time
.
tv_usec
,(
This
->
dinput
->
evsequence
)
++
);
break
;
case
ABS_RUDDER
:
This
->
js
.
rglSlider
[
1
]
=
map_axis
(
This
,
ABS_RUDDER
,
ie
.
value
);
GEN_EVENT
(
DIJOFS_SLIDER
(
1
),
This
->
js
.
rglSlider
[
1
],
ie
.
time
.
tv_usec
,(
This
->
dinput
->
evsequence
)
++
);
break
;
default:
FIXME
(
"unhandled joystick axe event (code %d, value %d)
\n
"
,
ie
.
code
,
ie
.
value
);
break
;
...
...
@@ -701,6 +713,8 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface,
case
12
:
/* Rx */
case
16
:
/* Ry */
case
20
:
/* Rz */
case
24
:
/* Slider 0 -> Throttle */
case
28
:
/* Slider 1 -> Rudder */
This
->
wantmin
[
ph
->
dwObj
/
4
]
=
pr
->
lMin
;
This
->
wantmax
[
ph
->
dwObj
/
4
]
=
pr
->
lMax
;
break
;
...
...
@@ -846,6 +860,10 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
ddoi
.
guidType
=
GUID_Slider
;
ddoi
.
dwOfs
=
DIJOFS_SLIDER
(
0
);
break
;
case
ABS_RUDDER
:
ddoi
.
guidType
=
GUID_Slider
;
ddoi
.
dwOfs
=
DIJOFS_SLIDER
(
1
);
break
;
default:
FIXME
(
"unhandled abs axis %d, ignoring!
\n
"
,
i
);
}
...
...
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