Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
3f3d4453
Commit
3f3d4453
authored
Jun 04, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use nameless unions in rawinput.c.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9f193d5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
rawinput.c
dlls/user32/rawinput.c
+20
-22
No files found.
dlls/user32/rawinput.c
View file @
3f3d4453
...
...
@@ -21,8 +21,6 @@
#include <stdarg.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
...
...
@@ -203,9 +201,9 @@ static void find_devices(void)
WARN
(
"Failed to get attributes.
\n
"
);
device
->
info
.
dwType
=
RIM_TYPEHID
;
device
->
info
.
u
.
hid
.
dwVendorId
=
attr
.
VendorID
;
device
->
info
.
u
.
hid
.
dwProductId
=
attr
.
ProductID
;
device
->
info
.
u
.
hid
.
dwVersionNumber
=
attr
.
VersionNumber
;
device
->
info
.
hid
.
dwVendorId
=
attr
.
VendorID
;
device
->
info
.
hid
.
dwProductId
=
attr
.
ProductID
;
device
->
info
.
hid
.
dwVersionNumber
=
attr
.
VersionNumber
;
if
(
!
HidD_GetPreparsedData
(
device
->
file
,
&
device
->
data
))
WARN
(
"Failed to get preparsed data.
\n
"
);
...
...
@@ -213,8 +211,8 @@ static void find_devices(void)
if
(
!
HidP_GetCaps
(
device
->
data
,
&
caps
))
WARN
(
"Failed to get caps.
\n
"
);
device
->
info
.
u
.
hid
.
usUsagePage
=
caps
.
UsagePage
;
device
->
info
.
u
.
hid
.
usUsage
=
caps
.
Usage
;
device
->
info
.
hid
.
usUsagePage
=
caps
.
UsagePage
;
device
->
info
.
hid
.
usUsage
=
caps
.
Usage
;
}
SetupDiDestroyDeviceInfoList
(
set
);
...
...
@@ -229,7 +227,7 @@ static void find_devices(void)
continue
;
device
->
info
.
dwType
=
RIM_TYPEMOUSE
;
device
->
info
.
u
.
mouse
=
mouse_info
;
device
->
info
.
mouse
=
mouse_info
;
}
SetupDiDestroyDeviceInfoList
(
set
);
...
...
@@ -244,7 +242,7 @@ static void find_devices(void)
continue
;
device
->
info
.
dwType
=
RIM_TYPEKEYBOARD
;
device
->
info
.
u
.
keyboard
=
keyboard_info
;
device
->
info
.
keyboard
=
keyboard_info
;
}
SetupDiDestroyDeviceInfoList
(
set
);
...
...
@@ -276,8 +274,8 @@ BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage)
if
(
!
(
device
=
find_device_from_handle
(
handle
)))
return
FALSE
;
if
(
device
->
info
.
dwType
!=
RIM_TYPEHID
)
return
FALSE
;
*
usage_page
=
device
->
info
.
u
.
hid
.
usUsagePage
;
*
usage
=
device
->
info
.
u
.
hid
.
usUsage
;
*
usage_page
=
device
->
info
.
hid
.
usUsagePage
;
*
usage
=
device
->
info
.
hid
.
usUsage
;
return
TRUE
;
}
...
...
@@ -317,36 +315,36 @@ BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_ms
rawinput
->
header
.
wParam
=
0
;
rawinput
->
data
.
mouse
.
usFlags
=
MOUSE_MOVE_RELATIVE
;
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
=
0
;
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonData
=
0
;
rawinput
->
data
.
mouse
.
usButtonFlags
=
0
;
rawinput
->
data
.
mouse
.
usButtonData
=
0
;
for
(
i
=
1
;
i
<
ARRAY_SIZE
(
button_flags
);
++
i
)
{
if
(
msg_data
->
flags
&
(
1
<<
i
))
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
button_flags
[
i
];
rawinput
->
data
.
mouse
.
usButtonFlags
|=
button_flags
[
i
];
}
if
(
msg_data
->
flags
&
MOUSEEVENTF_WHEEL
)
{
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
RI_MOUSE_WHEEL
;
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonData
=
msg_data
->
rawinput
.
mouse
.
data
;
rawinput
->
data
.
mouse
.
usButtonFlags
|=
RI_MOUSE_WHEEL
;
rawinput
->
data
.
mouse
.
usButtonData
=
msg_data
->
rawinput
.
mouse
.
data
;
}
if
(
msg_data
->
flags
&
MOUSEEVENTF_HWHEEL
)
{
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
RI_MOUSE_HORIZONTAL_WHEEL
;
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonData
=
msg_data
->
rawinput
.
mouse
.
data
;
rawinput
->
data
.
mouse
.
usButtonFlags
|=
RI_MOUSE_HORIZONTAL_WHEEL
;
rawinput
->
data
.
mouse
.
usButtonData
=
msg_data
->
rawinput
.
mouse
.
data
;
}
if
(
msg_data
->
flags
&
MOUSEEVENTF_XDOWN
)
{
if
(
msg_data
->
rawinput
.
mouse
.
data
==
XBUTTON1
)
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
RI_MOUSE_BUTTON_4_DOWN
;
rawinput
->
data
.
mouse
.
usButtonFlags
|=
RI_MOUSE_BUTTON_4_DOWN
;
else
if
(
msg_data
->
rawinput
.
mouse
.
data
==
XBUTTON2
)
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
RI_MOUSE_BUTTON_5_DOWN
;
rawinput
->
data
.
mouse
.
usButtonFlags
|=
RI_MOUSE_BUTTON_5_DOWN
;
}
if
(
msg_data
->
flags
&
MOUSEEVENTF_XUP
)
{
if
(
msg_data
->
rawinput
.
mouse
.
data
==
XBUTTON1
)
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
RI_MOUSE_BUTTON_4_UP
;
rawinput
->
data
.
mouse
.
usButtonFlags
|=
RI_MOUSE_BUTTON_4_UP
;
else
if
(
msg_data
->
rawinput
.
mouse
.
data
==
XBUTTON2
)
rawinput
->
data
.
mouse
.
u
.
s
.
u
sButtonFlags
|=
RI_MOUSE_BUTTON_5_UP
;
rawinput
->
data
.
mouse
.
usButtonFlags
|=
RI_MOUSE_BUTTON_5_UP
;
}
rawinput
->
data
.
mouse
.
ulRawButtons
=
0
;
...
...
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