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
09c6bf41
Commit
09c6bf41
authored
Apr 26, 2008
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Apr 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Fix MapVirtualKeyEx to properly map left-right modifier keys.
parent
56989b6e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
13 deletions
+68
-13
input.c
dlls/user32/tests/input.c
+22
-0
keyboard.c
dlls/winex11.drv/keyboard.c
+46
-13
No files found.
dlls/user32/tests/input.c
View file @
09c6bf41
...
...
@@ -1111,6 +1111,27 @@ static void test_GetMouseMovePointsEx(void)
#undef MYERROR
}
static
void
test_key_map
(
void
)
{
HKL
kl
=
GetKeyboardLayout
(
0
);
UINT
kL
,
kR
,
s
,
sL
;
s
=
MapVirtualKeyEx
(
VK_SHIFT
,
MAPVK_VK_TO_VSC
,
kl
);
ok
(
s
!=
0
,
"MapVirtualKeyEx(VK_SHIFT) should return non-zero
\n
"
);
sL
=
MapVirtualKeyEx
(
VK_LSHIFT
,
MAPVK_VK_TO_VSC
,
kl
);
ok
(
s
==
sL
,
"%x != %x
\n
"
,
s
,
sL
);
kL
=
MapVirtualKeyEx
(
0x2a
,
MAPVK_VSC_TO_VK
,
kl
);
ok
(
kL
==
VK_SHIFT
,
"Scan code -> vKey = %x (not VK_SHIFT)
\n
"
,
kL
);
kR
=
MapVirtualKeyEx
(
0x36
,
MAPVK_VSC_TO_VK
,
kl
);
ok
(
kR
==
VK_SHIFT
,
"Scan code -> vKey = %x (not VK_SHIFT)
\n
"
,
kR
);
kL
=
MapVirtualKeyEx
(
0x2a
,
MAPVK_VSC_TO_VK_EX
,
kl
);
ok
(
kL
==
VK_LSHIFT
,
"Scan code -> vKey = %x (not VK_LSHIFT)
\n
"
,
kL
);
kR
=
MapVirtualKeyEx
(
0x36
,
MAPVK_VSC_TO_VK_EX
,
kl
);
ok
(
kR
==
VK_RSHIFT
,
"Scan code -> vKey = %x (not VK_RSHIFT)
\n
"
,
kR
);
}
START_TEST
(
input
)
{
init_function_pointers
();
...
...
@@ -1123,6 +1144,7 @@ START_TEST(input)
test_Input_blackbox
();
test_keynames
();
test_mouse_ll_hook
();
test_key_map
();
if
(
pGetMouseMovePointsEx
)
test_GetMouseMovePointsEx
();
...
...
dlls/winex11.drv/keyboard.c
View file @
09c6bf41
...
...
@@ -2053,31 +2053,64 @@ UINT X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl)
if
(
hkl
!=
X11DRV_GetKeyboardLayout
(
0
))
FIXME
(
"keyboard layout %p is not supported
\n
"
,
hkl
);
switch
(
wMapType
)
{
switch
(
wMapType
)
{
case
MAPVK_VK_TO_VSC
:
/* vkey-code to scan-code */
case
MAPVK_VK_TO_VSC_EX
:
/* FIXME: should differentiate between
left and right keys */
case
MAPVK_VK_TO_VSC_EX
:
{
/* let's do vkey -> keycode -> scan */
int
keyc
;
for
(
keyc
=
min_keycode
;
keyc
<=
max_keycode
;
keyc
++
)
if
((
keyc2vkey
[
keyc
]
&
0xFF
)
==
wCode
)
returnMVK
(
keyc2scan
[
keyc
]
&
0xFF
);
switch
(
wCode
)
{
case
VK_SHIFT
:
wCode
=
VK_LSHIFT
;
break
;
case
VK_CONTROL
:
wCode
=
VK_LCONTROL
;
break
;
case
VK_MENU
:
wCode
=
VK_LMENU
;
break
;
}
/* let's do vkey -> keycode -> scan */
for
(
keyc
=
min_keycode
;
keyc
<=
max_keycode
;
keyc
++
)
if
((
keyc2vkey
[
keyc
]
&
0xFF
)
==
wCode
)
break
;
if
(
keyc
>
max_keycode
)
{
TRACE
(
"returning no scan-code.
\n
"
);
return
0
;
}
returnMVK
(
keyc2scan
[
keyc
]
&
0xFF
);
}
case
MAPVK_VSC_TO_VK
:
/* scan-code to vkey-code */
case
MAPVK_VSC_TO_VK_EX
:
/* FIXME: should differentiate between
left and right keys */
case
MAPVK_VSC_TO_VK_EX
:
{
/* let's do scan -> keycode -> vkey */
int
keyc
;
for
(
keyc
=
min_keycode
;
keyc
<=
max_keycode
;
keyc
++
)
if
((
keyc2scan
[
keyc
]
&
0xFF
)
==
(
wCode
&
0xFF
))
returnMVK
(
keyc2vkey
[
keyc
]
&
0xFF
);
UINT
vkey
;
/* let's do scan -> keycode -> vkey */
for
(
keyc
=
min_keycode
;
keyc
<=
max_keycode
;
keyc
++
)
if
((
keyc2scan
[
keyc
]
&
0xFF
)
==
(
wCode
&
0xFF
))
break
;
if
(
keyc
>
max_keycode
)
{
TRACE
(
"returning no vkey-code.
\n
"
);
return
0
;
}
vkey
=
keyc2vkey
[
keyc
]
&
0xFF
;
if
(
wMapType
==
MAPVK_VSC_TO_VK
)
switch
(
vkey
)
{
case
VK_LSHIFT
:
case
VK_RSHIFT
:
vkey
=
VK_SHIFT
;
break
;
case
VK_LCONTROL
:
case
VK_RCONTROL
:
vkey
=
VK_CONTROL
;
break
;
case
VK_LMENU
:
case
VK_RMENU
:
vkey
=
VK_MENU
;
break
;
}
returnMVK
(
vkey
);
}
case
MAPVK_VK_TO_CHAR
:
/* vkey-code to unshifted ANSI code */
{
/* we still don't know what "unshifted" means. in windows VK_W (0x57)
...
...
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