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
b7c5ff05
Commit
b7c5ff05
authored
Sep 22, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Sep 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implement OemKeyScan().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ddc16585
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
input.c
dlls/user32/input.c
+15
-2
input.c
dlls/user32/tests/input.c
+32
-0
No files found.
dlls/user32/input.c
View file @
b7c5ff05
...
...
@@ -884,9 +884,22 @@ WORD WINAPI VkKeyScanExW(WCHAR cChar, HKL dwhkl)
/**********************************************************************
* OemKeyScan (USER32.@)
*/
DWORD
WINAPI
OemKeyScan
(
WORD
wOemChar
)
DWORD
WINAPI
OemKeyScan
(
WORD
oem
)
{
return
wOemChar
;
WCHAR
wchr
;
DWORD
vkey
,
scan
;
char
oem_char
=
LOBYTE
(
oem
);
if
(
!
OemToCharBuffW
(
&
oem_char
,
&
wchr
,
1
))
return
-
1
;
vkey
=
VkKeyScanW
(
wchr
);
scan
=
MapVirtualKeyW
(
LOBYTE
(
vkey
),
MAPVK_VK_TO_VSC
);
if
(
!
scan
)
return
-
1
;
vkey
&=
0xff00
;
vkey
<<=
8
;
return
vkey
|
scan
;
}
/******************************************************************************
...
...
dlls/user32/tests/input.c
View file @
b7c5ff05
...
...
@@ -53,6 +53,7 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "wine/test.h"
...
...
@@ -2493,6 +2494,36 @@ static void test_GetKeyState(void)
CloseHandle
(
semaphores
[
1
]);
}
static
void
test_OemKeyScan
(
void
)
{
DWORD
ret
,
expect
,
vkey
,
scan
;
WCHAR
oem
,
wchr
;
char
oem_char
;
for
(
oem
=
0
;
oem
<
0x200
;
oem
++
)
{
ret
=
OemKeyScan
(
oem
);
oem_char
=
LOBYTE
(
oem
);
if
(
!
OemToCharBuffW
(
&
oem_char
,
&
wchr
,
1
))
expect
=
-
1
;
else
{
vkey
=
VkKeyScanW
(
wchr
);
scan
=
MapVirtualKeyW
(
LOBYTE
(
vkey
),
MAPVK_VK_TO_VSC
);
if
(
!
scan
)
expect
=
-
1
;
else
{
vkey
&=
0xff00
;
vkey
<<=
8
;
expect
=
vkey
|
scan
;
}
}
ok
(
ret
==
expect
,
"%04x: got %08x expected %08x
\n
"
,
oem
,
ret
,
expect
);
}
}
START_TEST
(
input
)
{
init_function_pointers
();
...
...
@@ -2516,6 +2547,7 @@ START_TEST(input)
test_key_names
();
test_attach_input
();
test_GetKeyState
();
test_OemKeyScan
();
if
(
pGetMouseMovePointsEx
)
test_GetMouseMovePointsEx
();
...
...
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