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
2239aae9
Commit
2239aae9
authored
May 07, 2019
by
Andrew Eikum
Committed by
Alexandre Julliard
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Report hatswitch values correctly.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d0c5a5e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
19 deletions
+25
-19
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+12
-9
bus_udev.c
dlls/winebus.sys/bus_udev.c
+12
-9
controller.h
dlls/winebus.sys/controller.h
+1
-1
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
2239aae9
...
...
@@ -303,15 +303,18 @@ static void set_hat_value(struct platform_private *ext, int index, int value)
offset
=
ext
->
hat_start
+
index
;
switch
(
value
)
{
case
SDL_HAT_CENTERED
:
ext
->
report_buffer
[
offset
]
=
8
;
break
;
case
SDL_HAT_UP
:
ext
->
report_buffer
[
offset
]
=
0
;
break
;
case
SDL_HAT_RIGHTUP
:
ext
->
report_buffer
[
offset
]
=
1
;
break
;
case
SDL_HAT_RIGHT
:
ext
->
report_buffer
[
offset
]
=
2
;
break
;
case
SDL_HAT_RIGHTDOWN
:
ext
->
report_buffer
[
offset
]
=
3
;
break
;
case
SDL_HAT_DOWN
:
ext
->
report_buffer
[
offset
]
=
4
;
break
;
case
SDL_HAT_LEFTDOWN
:
ext
->
report_buffer
[
offset
]
=
5
;
break
;
case
SDL_HAT_LEFT
:
ext
->
report_buffer
[
offset
]
=
6
;
break
;
case
SDL_HAT_LEFTUP
:
ext
->
report_buffer
[
offset
]
=
7
;
break
;
/* 8 1 2
* 7 0 3
* 6 5 4 */
case
SDL_HAT_CENTERED
:
ext
->
report_buffer
[
offset
]
=
0
;
break
;
case
SDL_HAT_UP
:
ext
->
report_buffer
[
offset
]
=
1
;
break
;
case
SDL_HAT_RIGHTUP
:
ext
->
report_buffer
[
offset
]
=
2
;
break
;
case
SDL_HAT_RIGHT
:
ext
->
report_buffer
[
offset
]
=
3
;
break
;
case
SDL_HAT_RIGHTDOWN
:
ext
->
report_buffer
[
offset
]
=
4
;
break
;
case
SDL_HAT_DOWN
:
ext
->
report_buffer
[
offset
]
=
5
;
break
;
case
SDL_HAT_LEFTDOWN
:
ext
->
report_buffer
[
offset
]
=
6
;
break
;
case
SDL_HAT_LEFT
:
ext
->
report_buffer
[
offset
]
=
7
;
break
;
case
SDL_HAT_LEFTUP
:
ext
->
report_buffer
[
offset
]
=
8
;
break
;
}
}
...
...
dlls/winebus.sys/bus_udev.c
View file @
2239aae9
...
...
@@ -303,32 +303,35 @@ static void set_abs_axis_value(struct wine_input_private *ext, int code, int val
ext
->
hat_values
[
index
]
=
value
;
if
((
code
-
ABS_HAT0X
)
%
2
)
index
--
;
/* 8 1 2
* 7 0 3
* 6 5 4 */
if
(
ext
->
hat_values
[
index
]
==
0
)
{
if
(
ext
->
hat_values
[
index
+
1
]
==
0
)
value
=
8
;
else
if
(
ext
->
hat_values
[
index
+
1
]
<
0
)
value
=
0
;
else
if
(
ext
->
hat_values
[
index
+
1
]
<
0
)
value
=
1
;
else
value
=
4
;
value
=
5
;
}
else
if
(
ext
->
hat_values
[
index
]
>
0
)
{
if
(
ext
->
hat_values
[
index
+
1
]
==
0
)
value
=
2
;
value
=
3
;
else
if
(
ext
->
hat_values
[
index
+
1
]
<
0
)
value
=
1
;
value
=
2
;
else
value
=
3
;
value
=
4
;
}
else
{
if
(
ext
->
hat_values
[
index
+
1
]
==
0
)
value
=
6
;
else
if
(
ext
->
hat_values
[
index
+
1
]
<
0
)
value
=
7
;
else
if
(
ext
->
hat_values
[
index
+
1
]
<
0
)
value
=
8
;
else
value
=
5
;
value
=
6
;
}
ext
->
current_report_buffer
[
ext
->
hat_map
[
index
]]
=
value
;
}
...
...
dlls/winebus.sys/controller.h
View file @
2239aae9
...
...
@@ -75,7 +75,7 @@ static const BYTE REPORT_REL_AXIS_TAIL[] = {
static
const
BYTE
REPORT_HATSWITCH
[]
=
{
0x05
,
0x01
,
/* USAGE_PAGE (Generic Desktop) */
0x09
,
0x39
,
/* USAGE (Hatswitch) */
0x15
,
0x0
0
,
/* LOGICAL_MINIMUM (0
) */
0x15
,
0x0
1
,
/* LOGICAL_MINIMUM (1
) */
0x25
,
0x08
,
/* LOGICAL_MAXIMUM (0x08) */
0x35
,
0x00
,
/* PHYSICAL_MINIMUM (0) */
0x45
,
0x08
,
/* PHYSICAL_MAXIMUM (8) */
...
...
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