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
85e105bd
Commit
85e105bd
authored
Nov 20, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Nov 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a GetKeyboardLayoutList driver entry.
parent
a3a19518
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
55 deletions
+69
-55
driver.c
dlls/user32/driver.c
+66
-0
input.c
dlls/user32/input.c
+2
-55
user_private.h
dlls/user32/user_private.h
+1
-0
No files found.
dlls/user32/driver.c
View file @
85e105bd
...
...
@@ -99,6 +99,7 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC
(
GetAsyncKeyState
);
GET_USER_FUNC
(
GetKeyNameText
);
GET_USER_FUNC
(
GetKeyboardLayout
);
GET_USER_FUNC
(
GetKeyboardLayoutList
);
GET_USER_FUNC
(
GetKeyboardLayoutName
);
GET_USER_FUNC
(
LoadKeyboardLayout
);
GET_USER_FUNC
(
MapVirtualKeyEx
);
...
...
@@ -195,6 +196,64 @@ static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
return
-
1
;
}
static
UINT
CDECL
nulldrv_GetKeyboardLayoutList
(
INT
size
,
HKL
*
layouts
)
{
HKEY
hKeyKeyboard
;
DWORD
rc
;
INT
count
=
0
;
ULONG_PTR
baselayout
;
LANGID
langid
;
static
const
WCHAR
szKeyboardReg
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'K'
,
'e'
,
'y'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
' '
,
'L'
,
'a'
,
'y'
,
'o'
,
'u'
,
't'
,
's'
,
0
};
baselayout
=
GetUserDefaultLCID
();
langid
=
PRIMARYLANGID
(
LANGIDFROMLCID
(
baselayout
));
if
(
langid
==
LANG_CHINESE
||
langid
==
LANG_JAPANESE
||
langid
==
LANG_KOREAN
)
baselayout
|=
0xe001
<<
16
;
/* IME */
else
baselayout
|=
baselayout
<<
16
;
/* Enumerate the Registry */
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
szKeyboardReg
,
&
hKeyKeyboard
);
if
(
rc
==
ERROR_SUCCESS
)
{
do
{
WCHAR
szKeyName
[
9
];
HKL
layout
;
rc
=
RegEnumKeyW
(
hKeyKeyboard
,
count
,
szKeyName
,
9
);
if
(
rc
==
ERROR_SUCCESS
)
{
layout
=
(
HKL
)(
ULONG_PTR
)
strtoulW
(
szKeyName
,
NULL
,
16
);
if
(
baselayout
!=
0
&&
layout
==
(
HKL
)
baselayout
)
baselayout
=
0
;
/* found in the registry do not add again */
if
(
size
&&
layouts
)
{
if
(
count
>=
size
)
break
;
layouts
[
count
]
=
layout
;
}
count
++
;
}
}
while
(
rc
==
ERROR_SUCCESS
);
RegCloseKey
(
hKeyKeyboard
);
}
/* make sure our base layout is on the list */
if
(
baselayout
!=
0
)
{
if
(
size
&&
layouts
)
{
if
(
count
<
size
)
{
layouts
[
count
]
=
(
HKL
)
baselayout
;
count
++
;
}
}
else
count
++
;
}
return
count
;
}
static
INT
CDECL
nulldrv_GetKeyNameText
(
LONG
lparam
,
LPWSTR
buffer
,
INT
size
)
{
return
0
;
...
...
@@ -455,6 +514,7 @@ static USER_DRIVER null_driver =
nulldrv_GetAsyncKeyState
,
nulldrv_GetKeyNameText
,
nulldrv_GetKeyboardLayout
,
nulldrv_GetKeyboardLayoutList
,
nulldrv_GetKeyboardLayoutName
,
nulldrv_LoadKeyboardLayout
,
nulldrv_MapVirtualKeyEx
,
...
...
@@ -542,6 +602,11 @@ static HKL CDECL loaderdrv_GetKeyboardLayout( DWORD thread_id )
return
load_driver
()
->
pGetKeyboardLayout
(
thread_id
);
}
static
UINT
CDECL
loaderdrv_GetKeyboardLayoutList
(
INT
size
,
HKL
*
layouts
)
{
return
load_driver
()
->
pGetKeyboardLayoutList
(
size
,
layouts
);
}
static
BOOL
CDECL
loaderdrv_GetKeyboardLayoutName
(
LPWSTR
name
)
{
return
load_driver
()
->
pGetKeyboardLayoutName
(
name
);
...
...
@@ -704,6 +769,7 @@ static USER_DRIVER lazy_load_driver =
loaderdrv_GetAsyncKeyState
,
loaderdrv_GetKeyNameText
,
loaderdrv_GetKeyboardLayout
,
loaderdrv_GetKeyboardLayoutList
,
loaderdrv_GetKeyboardLayoutName
,
loaderdrv_LoadKeyboardLayout
,
loaderdrv_MapVirtualKeyEx
,
...
...
dlls/user32/input.c
View file @
85e105bd
...
...
@@ -1074,62 +1074,9 @@ BOOL WINAPI BlockInput(BOOL fBlockIt)
*/
UINT
WINAPI
GetKeyboardLayoutList
(
INT
nBuff
,
HKL
*
layouts
)
{
HKEY
hKeyKeyboard
;
DWORD
rc
;
INT
count
=
0
;
ULONG_PTR
baselayout
;
LANGID
langid
;
static
const
WCHAR
szKeyboardReg
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'K'
,
'e'
,
'y'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
' '
,
'L'
,
'a'
,
'y'
,
'o'
,
'u'
,
't'
,
's'
,
0
};
TRACE_
(
keyboard
)(
"(%d,%p)
\n
"
,
nBuff
,
layouts
);
baselayout
=
GetUserDefaultLCID
();
langid
=
PRIMARYLANGID
(
LANGIDFROMLCID
(
baselayout
));
if
(
langid
==
LANG_CHINESE
||
langid
==
LANG_JAPANESE
||
langid
==
LANG_KOREAN
)
baselayout
|=
0xe001
<<
16
;
/* IME */
else
baselayout
|=
baselayout
<<
16
;
/* Enumerate the Registry */
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
szKeyboardReg
,
&
hKeyKeyboard
);
if
(
rc
==
ERROR_SUCCESS
)
{
do
{
WCHAR
szKeyName
[
9
];
HKL
layout
;
rc
=
RegEnumKeyW
(
hKeyKeyboard
,
count
,
szKeyName
,
9
);
if
(
rc
==
ERROR_SUCCESS
)
{
layout
=
(
HKL
)(
ULONG_PTR
)
strtoulW
(
szKeyName
,
NULL
,
16
);
if
(
baselayout
!=
0
&&
layout
==
(
HKL
)
baselayout
)
baselayout
=
0
;
/* found in the registry do not add again */
if
(
nBuff
&&
layouts
)
{
if
(
count
>=
nBuff
)
break
;
layouts
[
count
]
=
layout
;
}
count
++
;
}
}
while
(
rc
==
ERROR_SUCCESS
);
RegCloseKey
(
hKeyKeyboard
);
}
/* make sure our base layout is on the list */
if
(
baselayout
!=
0
)
{
if
(
nBuff
&&
layouts
)
{
if
(
count
<
nBuff
)
{
layouts
[
count
]
=
(
HKL
)
baselayout
;
count
++
;
}
}
else
count
++
;
}
TRACE_
(
keyboard
)(
"(%d, %p)
\n
"
,
nBuff
,
layouts
);
return
count
;
return
USER_Driver
->
pGetKeyboardLayoutList
(
nBuff
,
layouts
)
;
}
...
...
dlls/user32/user_private.h
View file @
85e105bd
...
...
@@ -64,6 +64,7 @@ typedef struct tagUSER_DRIVER {
SHORT
(
CDECL
*
pGetAsyncKeyState
)(
INT
);
INT
(
CDECL
*
pGetKeyNameText
)(
LONG
,
LPWSTR
,
INT
);
HKL
(
CDECL
*
pGetKeyboardLayout
)(
DWORD
);
UINT
(
CDECL
*
pGetKeyboardLayoutList
)(
INT
,
HKL
*
);
BOOL
(
CDECL
*
pGetKeyboardLayoutName
)(
LPWSTR
);
HKL
(
CDECL
*
pLoadKeyboardLayout
)(
LPCWSTR
,
UINT
);
UINT
(
CDECL
*
pMapVirtualKeyEx
)(
UINT
,
UINT
,
HKL
);
...
...
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