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
4cf6023c
Commit
4cf6023c
authored
Apr 30, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a default GetKeyNameTextW implementation.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1feb0548
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
4 deletions
+83
-4
driver.c
dlls/user32/driver.c
+1
-1
input.c
dlls/user32/input.c
+82
-3
No files found.
dlls/user32/driver.c
View file @
4cf6023c
...
...
@@ -255,7 +255,7 @@ static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
static
INT
CDECL
nulldrv_GetKeyNameText
(
LONG
lparam
,
LPWSTR
buffer
,
INT
size
)
{
return
0
;
return
-
1
;
/* use default implementation */
}
static
HKL
CDECL
nulldrv_GetKeyboardLayout
(
DWORD
thread_id
)
...
...
dlls/user32/input.c
View file @
4cf6023c
...
...
@@ -853,6 +853,43 @@ static const UINT kbd_en_vk2char[] =
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
};
static
const
WCHAR
*
kbd_en_vscname
[]
=
{
0
,
L"Esc"
,
0
,
0
,
0
,
0
,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,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
};
/******************************************************************************
* MapVirtualKeyExW (USER32.@)
...
...
@@ -1007,10 +1044,52 @@ INT WINAPI GetKeyNameTextA(LONG lParam, LPSTR lpBuffer, INT nSize)
/****************************************************************************
* GetKeyNameTextW (USER32.@)
*/
INT
WINAPI
GetKeyNameTextW
(
LONG
lParam
,
LPWSTR
lpBuffer
,
INT
nSize
)
INT
WINAPI
GetKeyNameTextW
(
LONG
lparam
,
LPWSTR
buffer
,
INT
size
)
{
if
(
!
lpBuffer
||
!
nSize
)
return
0
;
return
USER_Driver
->
pGetKeyNameText
(
lParam
,
lpBuffer
,
nSize
);
INT
code
=
((
lparam
>>
16
)
&
0x1ff
),
vkey
,
len
;
UINT
vsc2vk_size
,
vscname_size
;
const
WCHAR
*
const
*
vscname
;
const
UINT
*
vsc2vk
;
WCHAR
tmp
[
2
];
TRACE_
(
keyboard
)(
"lparam %d, buffer %p, size %d.
\n
"
,
lparam
,
buffer
,
size
);
if
(
!
buffer
||
!
size
)
return
0
;
if
((
len
=
USER_Driver
->
pGetKeyNameText
(
lparam
,
buffer
,
size
))
>=
0
)
return
len
;
/* FIXME: English keyboard layout specific */
vsc2vk
=
kbd_en_vsc2vk
;
vsc2vk_size
=
ARRAYSIZE
(
kbd_en_vsc2vk
);
vscname
=
kbd_en_vscname
;
vscname_size
=
ARRAYSIZE
(
kbd_en_vscname
);
if
(
lparam
&
0x2000000
)
{
switch
((
vkey
=
vsc2vk
[
code
]))
{
case
VK_RSHIFT
:
case
VK_RCONTROL
:
case
VK_RMENU
:
for
(
code
=
0
;
code
<
vsc2vk_size
;
++
code
)
if
(
vsc2vk
[
code
]
==
(
vkey
-
1
))
break
;
break
;
}
}
if
(
code
>=
vscname_size
)
buffer
[
0
]
=
0
;
else
if
(
vscname
[
code
])
lstrcpynW
(
buffer
,
vscname
[
code
],
size
);
else
{
vkey
=
MapVirtualKeyW
(
code
&
0xff
,
MAPVK_VSC_TO_VK
);
tmp
[
0
]
=
MapVirtualKeyW
(
vkey
,
MAPVK_VK_TO_CHAR
);
tmp
[
1
]
=
0
;
lstrcpynW
(
buffer
,
tmp
,
size
);
}
len
=
wcslen
(
buffer
);
TRACE_
(
keyboard
)(
"ret %d, str %s.
\n
"
,
len
,
debugstr_w
(
buffer
)
);
return
len
;
}
/****************************************************************************
...
...
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