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
512112eb
Commit
512112eb
authored
May 06, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Set keyboard layout preload key on init.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8ec1206b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
39 deletions
+22
-39
input.c
dlls/user32/input.c
+19
-0
user_main.c
dlls/user32/user_main.c
+1
-0
user_private.h
dlls/user32/user_private.h
+2
-0
keyboard.c
dlls/winex11.drv/keyboard.c
+0
-39
No files found.
dlls/user32/input.c
View file @
512112eb
...
...
@@ -115,6 +115,25 @@ static HKL get_locale_kbd_layout(void)
/**********************************************************************
* keyboard_init
*/
void
keyboard_init
(
void
)
{
WCHAR
layout
[
KL_NAMELENGTH
];
HKEY
hkey
;
if
(
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
L"Keyboard Layout
\\
Preload"
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
))
return
;
if
(
GetKeyboardLayoutNameW
(
layout
))
RegSetValueExW
(
hkey
,
L"1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
layout
,
sizeof
(
layout
)
);
RegCloseKey
(
hkey
);
}
/**********************************************************************
* set_capture_window
*/
BOOL
set_capture_window
(
HWND
hwnd
,
UINT
gui_flags
,
HWND
*
prev_ret
)
...
...
dlls/user32/user_main.c
View file @
512112eb
...
...
@@ -331,6 +331,7 @@ static BOOL process_attach(void)
/* Setup palette function pointers */
palette_init
();
keyboard_init
();
return
TRUE
;
}
...
...
dlls/user32/user_private.h
View file @
512112eb
...
...
@@ -242,6 +242,8 @@ struct hardware_msg_data;
extern
BOOL
rawinput_from_hardware_message
(
RAWINPUT
*
rawinput
,
const
struct
hardware_msg_data
*
msg_data
);
extern
struct
rawinput_thread_data
*
rawinput_thread_data
(
void
);
extern
void
keyboard_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
CLIPBOARD_ReleaseOwner
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
FOCUS_MouseActivate
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
set_capture_window
(
HWND
hwnd
,
UINT
gui_flags
,
HWND
*
prev_ret
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/keyboard.c
View file @
512112eb
...
...
@@ -1563,43 +1563,6 @@ static HKL get_locale_kbd_layout(void)
return
(
HKL
)
layout
;
}
/***********************************************************************
* GetKeyboardLayoutName (X11DRV.@)
*/
static
BOOL
CDECL
X11DRV_GetKeyboardLayoutName
(
LPWSTR
name
)
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'0'
,
'8'
,
'x'
,
0
};
DWORD
layout
;
layout
=
HandleToUlong
(
get_locale_kbd_layout
()
);
if
(
HIWORD
(
layout
)
==
LOWORD
(
layout
))
layout
=
LOWORD
(
layout
);
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
...
...
@@ -1634,8 +1597,6 @@ void X11DRV_InitKeyboard( Display *display )
};
int
vkey_range
;
set_kbd_layout_preload_key
();
EnterCriticalSection
(
&
kbd_section
);
XDisplayKeycodes
(
display
,
&
min_keycode
,
&
max_keycode
);
if
(
key_mapping
)
XFree
(
key_mapping
);
...
...
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