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
67a11c60
Commit
67a11c60
authored
Apr 14, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Set HKCU\Keyboard Layout\Preload key.
parent
ed70c76a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
21 deletions
+45
-21
keyboard.c
dlls/winex11.drv/keyboard.c
+45
-21
No files found.
dlls/winex11.drv/keyboard.c
View file @
67a11c60
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "winbase.h"
#include "winbase.h"
#include "wingdi.h"
#include "wingdi.h"
#include "winuser.h"
#include "winuser.h"
#include "winreg.h"
#include "winnls.h"
#include "winnls.h"
#include "x11drv.h"
#include "x11drv.h"
#include "wine/server.h"
#include "wine/server.h"
...
@@ -1613,6 +1614,48 @@ static HKL get_locale_kbd_layout(void)
...
@@ -1613,6 +1614,48 @@ static HKL get_locale_kbd_layout(void)
return
(
HKL
)
layout
;
return
(
HKL
)
layout
;
}
}
/***********************************************************************
* GetKeyboardLayoutName (X11DRV.@)
*/
BOOL
CDECL
X11DRV_GetKeyboardLayoutName
(
LPWSTR
name
)
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'0'
,
'8'
,
'l'
,
'x'
,
0
};
DWORD
layout
;
LANGID
langid
;
layout
=
main_key_tab
[
kbd_layout
].
lcid
;
/* see comment for get_locale_kbd_layout */
langid
=
PRIMARYLANGID
(
LANGIDFROMLCID
(
layout
));
if
(
langid
==
LANG_CHINESE
||
langid
==
LANG_JAPANESE
||
langid
==
LANG_KOREAN
)
layout
|=
0xe001
<<
16
;
/* FIXME */
sprintfW
(
name
,
formatW
,
layout
);
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
name
));
return
TRUE
;
}
static
void
set_kbd_layout_preload_key
(
void
)
{
static
const
WCHAR
preload
[]
=
{
'K'
,
'e'
,
'y'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
' '
,
'L'
,
'a'
,
'y'
,
'o'
,
'u'
,
't'
,
'\\'
,
'P'
,
'r'
,
'e'
,
'l'
,
'o'
,
'a'
,
'd'
,
0
};
static
const
WCHAR
one
[]
=
{
'1'
,
0
};
HKEY
hkey
;
WCHAR
layout
[
KL_NAMELENGTH
];
if
(
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
preload
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
))
return
;
if
(
!
RegQueryValueExW
(
hkey
,
one
,
NULL
,
NULL
,
NULL
,
NULL
))
{
RegCloseKey
(
hkey
);
return
;
}
if
(
X11DRV_GetKeyboardLayoutName
(
layout
))
RegSetValueExW
(
hkey
,
one
,
0
,
REG_SZ
,
(
const
BYTE
*
)
layout
,
sizeof
(
layout
));
RegCloseKey
(
hkey
);
}
/**********************************************************************
/**********************************************************************
* X11DRV_InitKeyboard
* X11DRV_InitKeyboard
...
@@ -1630,6 +1673,8 @@ void X11DRV_InitKeyboard( Display *display )
...
@@ -1630,6 +1673,8 @@ void X11DRV_InitKeyboard( Display *display )
const
char
(
*
lkey
)[
MAIN_LEN
][
4
];
const
char
(
*
lkey
)[
MAIN_LEN
][
4
];
char
vkey_used
[
256
]
=
{
0
};
char
vkey_used
[
256
]
=
{
0
};
set_kbd_layout_preload_key
();
wine_tsx11_lock
();
wine_tsx11_lock
();
XDisplayKeycodes
(
display
,
&
min_keycode
,
&
max_keycode
);
XDisplayKeycodes
(
display
,
&
min_keycode
,
&
max_keycode
);
ksp
=
XGetKeyboardMapping
(
display
,
min_keycode
,
ksp
=
XGetKeyboardMapping
(
display
,
min_keycode
,
...
@@ -1901,27 +1946,6 @@ HKL CDECL X11DRV_GetKeyboardLayout(DWORD dwThreadid)
...
@@ -1901,27 +1946,6 @@ HKL CDECL X11DRV_GetKeyboardLayout(DWORD dwThreadid)
/***********************************************************************
/***********************************************************************
* GetKeyboardLayoutName (X11DRV.@)
*/
BOOL
CDECL
X11DRV_GetKeyboardLayoutName
(
LPWSTR
name
)
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'0'
,
'8'
,
'l'
,
'x'
,
0
};
DWORD
layout
;
LANGID
langid
;
layout
=
main_key_tab
[
kbd_layout
].
lcid
;
/* see comment for get_locale_kbd_layout */
langid
=
PRIMARYLANGID
(
LANGIDFROMLCID
(
layout
));
if
(
langid
==
LANG_CHINESE
||
langid
==
LANG_JAPANESE
||
langid
==
LANG_KOREAN
)
layout
|=
0xe001
<<
16
;
/* FIXME */
sprintfW
(
name
,
formatW
,
layout
);
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
name
));
return
TRUE
;
}
/***********************************************************************
* LoadKeyboardLayout (X11DRV.@)
* LoadKeyboardLayout (X11DRV.@)
*/
*/
HKL
CDECL
X11DRV_LoadKeyboardLayout
(
LPCWSTR
name
,
UINT
flags
)
HKL
CDECL
X11DRV_LoadKeyboardLayout
(
LPCWSTR
name
,
UINT
flags
)
...
...
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