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
7c2ea163
Commit
7c2ea163
authored
Mar 01, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Introduce KbdLayerDescriptor user driver entry.
parent
d64ea8e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
8 deletions
+48
-8
driver.c
dlls/win32u/driver.c
+23
-0
input.c
dlls/win32u/input.c
+22
-8
gdi_driver.h
include/wine/gdi_driver.h
+3
-0
No files found.
dlls/win32u/driver.c
View file @
7c2ea163
...
...
@@ -715,6 +715,15 @@ static SHORT nulldrv_VkKeyScanEx( WCHAR ch, HKL layout )
return
-
256
;
/* use default implementation */
}
static
const
KBDTABLES
*
nulldrv_KbdLayerDescriptor
(
HKL
layout
)
{
return
NULL
;
}
static
void
nulldrv_ReleaseKbdTables
(
const
KBDTABLES
*
tables
)
{
}
static
UINT
nulldrv_ImeProcessKey
(
HIMC
himc
,
UINT
wparam
,
UINT
lparam
,
const
BYTE
*
state
)
{
return
0
;
...
...
@@ -1087,6 +1096,16 @@ static SHORT loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
return
load_driver
()
->
pVkKeyScanEx
(
ch
,
layout
);
}
static
const
KBDTABLES
*
loaderdrv_KbdLayerDescriptor
(
HKL
layout
)
{
return
load_driver
()
->
pKbdLayerDescriptor
(
layout
);
}
static
void
loaderdrv_ReleaseKbdTables
(
const
KBDTABLES
*
tables
)
{
return
load_driver
()
->
pReleaseKbdTables
(
tables
);
}
static
UINT
loaderdrv_ImeProcessKey
(
HIMC
himc
,
UINT
wparam
,
UINT
lparam
,
const
BYTE
*
state
)
{
return
load_driver
()
->
pImeProcessKey
(
himc
,
wparam
,
lparam
,
state
);
...
...
@@ -1213,6 +1232,8 @@ static const struct user_driver_funcs lazy_load_driver =
loaderdrv_ToUnicodeEx
,
loaderdrv_UnregisterHotKey
,
loaderdrv_VkKeyScanEx
,
loaderdrv_KbdLayerDescriptor
,
loaderdrv_ReleaseKbdTables
,
loaderdrv_ImeProcessKey
,
loaderdrv_ImeToAsciiEx
,
loaderdrv_NotifyIMEStatus
,
...
...
@@ -1296,6 +1317,8 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
SET_USER_FUNC
(
ToUnicodeEx
);
SET_USER_FUNC
(
UnregisterHotKey
);
SET_USER_FUNC
(
VkKeyScanEx
);
SET_USER_FUNC
(
KbdLayerDescriptor
);
SET_USER_FUNC
(
ReleaseKbdTables
);
SET_USER_FUNC
(
ImeProcessKey
);
SET_USER_FUNC
(
ImeToAsciiEx
);
SET_USER_FUNC
(
NotifyIMEStatus
);
...
...
dlls/win32u/input.c
View file @
7c2ea163
...
...
@@ -1016,13 +1016,16 @@ BOOL WINAPI NtUserSetKeyboardState( BYTE *state )
*/
WORD
WINAPI
NtUserVkKeyScanEx
(
WCHAR
chr
,
HKL
layout
)
{
const
KBDTABLES
*
kbd_tables
=
&
kbdus_tables
;
const
KBDTABLES
*
kbd_tables
;
SHORT
ret
;
TRACE_
(
keyboard
)(
"chr %s, layout %p
\n
"
,
debugstr_wn
(
&
chr
,
1
),
layout
);
if
((
ret
=
user_driver
->
pVkKeyScanEx
(
chr
,
layout
))
!=
-
256
)
return
ret
;
if
(
!
(
kbd_tables
=
user_driver
->
pKbdLayerDescriptor
(
layout
)))
kbd_tables
=
&
kbdus_tables
;
ret
=
kbd_tables_wchar_to_vkey
(
kbd_tables
,
chr
);
if
(
kbd_tables
!=
&
kbdus_tables
)
user_driver
->
pReleaseKbdTables
(
kbd_tables
);
TRACE_
(
keyboard
)(
"ret %04x
\n
"
,
ret
);
return
ret
;
...
...
@@ -1034,14 +1037,16 @@ WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout )
*/
UINT
WINAPI
NtUserMapVirtualKeyEx
(
UINT
code
,
UINT
type
,
HKL
layout
)
{
const
KBDTABLES
*
kbd_tables
=
&
kbdus_tables
;
BYTE
vsc2vk
[
0x300
],
vk2char
[
0x100
];
UINT
ret
;
const
KBDTABLES
*
kbd_tables
;
UINT
ret
=
0
;
TRACE_
(
keyboard
)(
"code %u, type %u, layout %p.
\n
"
,
code
,
type
,
layout
);
if
((
ret
=
user_driver
->
pMapVirtualKeyEx
(
code
,
type
,
layout
))
!=
-
1
)
return
ret
;
if
(
!
(
kbd_tables
=
user_driver
->
pKbdLayerDescriptor
(
layout
)))
kbd_tables
=
&
kbdus_tables
;
switch
(
type
)
{
case
MAPVK_VK_TO_VSC_EX
:
...
...
@@ -1101,9 +1106,11 @@ UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout )
break
;
default:
FIXME_
(
keyboard
)(
"unknown type %d
\n
"
,
type
);
return
0
;
break
;
}
if
(
kbd_tables
!=
&
kbdus_tables
)
user_driver
->
pReleaseKbdTables
(
kbd_tables
);
TRACE_
(
keyboard
)(
"returning 0x%04x
\n
"
,
ret
);
return
ret
;
}
...
...
@@ -1114,7 +1121,8 @@ UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout )
INT
WINAPI
NtUserGetKeyNameText
(
LONG
lparam
,
WCHAR
*
buffer
,
INT
size
)
{
INT
code
=
((
lparam
>>
16
)
&
0x1ff
),
vkey
,
len
;
const
KBDTABLES
*
kbd_tables
=
&
kbdus_tables
;
HKL
layout
=
NtUserGetKeyboardLayout
(
0
);
const
KBDTABLES
*
kbd_tables
;
VSC_LPWSTR
*
key_name
;
TRACE_
(
keyboard
)(
"lparam %#x, buffer %p, size %d.
\n
"
,
(
int
)
lparam
,
buffer
,
size
);
...
...
@@ -1122,6 +1130,8 @@ INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size )
if
(
!
buffer
||
!
size
)
return
0
;
if
((
len
=
user_driver
->
pGetKeyNameText
(
lparam
,
buffer
,
size
))
>=
0
)
return
len
;
if
(
!
(
kbd_tables
=
user_driver
->
pKbdLayerDescriptor
(
layout
)))
kbd_tables
=
&
kbdus_tables
;
if
(
lparam
&
0x2000000
)
{
BYTE
vsc2vk
[
0x300
];
...
...
@@ -1155,6 +1165,8 @@ INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size )
}
buffer
[
len
]
=
0
;
if
(
kbd_tables
!=
&
kbdus_tables
)
user_driver
->
pReleaseKbdTables
(
kbd_tables
);
TRACE_
(
keyboard
)(
"ret %d, str %s.
\n
"
,
len
,
debugstr_w
(
buffer
)
);
return
len
;
}
...
...
@@ -1165,7 +1177,7 @@ INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size )
INT
WINAPI
NtUserToUnicodeEx
(
UINT
virt
,
UINT
scan
,
const
BYTE
*
state
,
WCHAR
*
str
,
int
size
,
UINT
flags
,
HKL
layout
)
{
const
KBDTABLES
*
kbd_tables
=
&
kbdus_tables
;
const
KBDTABLES
*
kbd_tables
;
WCHAR
buffer
[
2
]
=
{
0
};
INT
len
;
...
...
@@ -1173,9 +1185,9 @@ INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
virt
,
scan
,
state
,
str
,
size
,
flags
,
layout
);
if
(
!
state
)
return
0
;
if
((
len
=
user_driver
->
pToUnicodeEx
(
virt
,
scan
,
state
,
str
,
size
,
flags
,
layout
))
>=
-
1
)
return
len
;
if
((
len
=
user_driver
->
pToUnicodeEx
(
virt
,
scan
,
state
,
str
,
size
,
flags
,
layout
))
>=
-
1
)
return
len
;
if
(
!
(
kbd_tables
=
user_driver
->
pKbdLayerDescriptor
(
layout
)))
kbd_tables
=
&
kbdus_tables
;
if
(
scan
&
0x8000
)
buffer
[
0
]
=
0
;
/* key up */
else
buffer
[
0
]
=
kbd_tables_vkey_to_wchar
(
kbd_tables
,
virt
,
state
);
...
...
@@ -1184,6 +1196,8 @@ INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
lstrcpynW
(
str
,
buffer
,
size
);
if
(
kbd_tables
!=
&
kbdus_tables
)
user_driver
->
pReleaseKbdTables
(
kbd_tables
);
TRACE_
(
keyboard
)(
"ret %d, str %s.
\n
"
,
len
,
debugstr_w
(
str
)
);
return
len
;
}
...
...
include/wine/gdi_driver.h
View file @
7c2ea163
...
...
@@ -29,6 +29,7 @@
#include "ntuser.h"
#include "immdev.h"
#include "ddk/d3dkmthk.h"
#include "kbd.h"
#include "wine/list.h"
struct
gdi_dc_funcs
;
...
...
@@ -292,6 +293,8 @@ struct user_driver_funcs
INT
(
*
pToUnicodeEx
)(
UINT
,
UINT
,
const
BYTE
*
,
LPWSTR
,
int
,
UINT
,
HKL
);
void
(
*
pUnregisterHotKey
)(
HWND
,
UINT
,
UINT
);
SHORT
(
*
pVkKeyScanEx
)(
WCHAR
,
HKL
);
const
KBDTABLES
*
(
*
pKbdLayerDescriptor
)(
HKL
);
void
(
*
pReleaseKbdTables
)(
const
KBDTABLES
*
);
/* IME functions */
UINT
(
*
pImeProcessKey
)(
HIMC
,
UINT
,
UINT
,
const
BYTE
*
);
UINT
(
*
pImeToAsciiEx
)(
UINT
,
UINT
,
const
BYTE
*
,
COMPOSITIONSTRING
*
,
HIMC
);
...
...
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