mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
winex11: Strip the _L or _R from X11DRV_GetKeyNameText when appropriate.
This commit is contained in:
parent
3f1c63c5bd
commit
f624876d3e
1 changed files with 18 additions and 0 deletions
|
@ -2301,6 +2301,24 @@ INT CDECL X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
|
|||
keys = keycode_to_keysym(display, keyc, 0);
|
||||
name = XKeysymToString(keys);
|
||||
wine_tsx11_unlock();
|
||||
|
||||
if (name && (vkey == VK_SHIFT || vkey == VK_CONTROL || vkey == VK_MENU))
|
||||
{
|
||||
char* idx = strrchr(name, '_');
|
||||
if (idx && (strcasecmp(idx, "_r") == 0 || strcasecmp(idx, "_l") == 0))
|
||||
{
|
||||
INT rc = 0;
|
||||
TRACE("found scan=%04x keyc=%u keysym=%lx modified_string=%s\n",
|
||||
scanCode, keyc, keys, debugstr_an(name,idx-name));
|
||||
if (lpBuffer && nSize)
|
||||
{
|
||||
rc = MultiByteToWideChar(CP_UNIXCP, 0, name, idx-name+1, lpBuffer, nSize);
|
||||
if (rc > 0) lpBuffer[rc - 1] = 0;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("found scan=%04x keyc=%u keysym=%04x string=%s\n",
|
||||
scanCode, keyc, (int)keys, debugstr_a(name));
|
||||
if (lpBuffer && nSize && name)
|
||||
|
|
Loading…
Reference in a new issue