Commit b52c89fc authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: For GetKeyNameText(), use the hard-coded table in preference to the Mac keyboard layout.

parent c4a28490
...@@ -1229,6 +1229,8 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) ...@@ -1229,6 +1229,8 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
UInt32 deadKeyState = 0; UInt32 deadKeyState = 0;
UniCharCount len; UniCharCount len;
OSStatus status; OSStatus status;
DWORD vkey;
int i;
uchr = (const UCKeyboardLayout*)CFDataGetBytePtr(thread_data->keyboard_layout_uchr); uchr = (const UCKeyboardLayout*)CFDataGetBytePtr(thread_data->keyboard_layout_uchr);
status = UCKeyTranslate(uchr, keyc, kUCKeyActionDisplay, 0, thread_data->keyboard_type, status = UCKeyTranslate(uchr, keyc, kUCKeyActionDisplay, 0, thread_data->keyboard_type,
...@@ -1237,13 +1239,8 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) ...@@ -1237,13 +1239,8 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
len = 0; len = 0;
if (len && isgraphW(buffer[0])) if (len && isgraphW(buffer[0]))
buffer[len] = 0; buffer[len] = 0;
else
{
DWORD vkey = thread_data->keyc2vkey[keyc];
int i;
if (scan & 0x100) vkey |= 0x100;
vkey = thread_data->keyc2vkey[keyc];
if (lparam & (1 << 25)) if (lparam & (1 << 25))
{ {
/* Caller doesn't care about distinctions between left and /* Caller doesn't care about distinctions between left and
...@@ -1262,7 +1259,8 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) ...@@ -1262,7 +1259,8 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
} }
} }
len = 0; if (scan & 0x100) vkey |= 0x100;
for (i = 0; i < sizeof(vkey_names) / sizeof(vkey_names[0]); i++) for (i = 0; i < sizeof(vkey_names) / sizeof(vkey_names[0]); i++)
{ {
if (vkey_names[i].vkey == vkey) if (vkey_names[i].vkey == vkey)
...@@ -1279,7 +1277,6 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) ...@@ -1279,7 +1277,6 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
snprintfW(buffer, size, format, vkey); snprintfW(buffer, size, format, vkey);
len = strlenW(buffer); len = strlenW(buffer);
} }
}
if (!len) if (!len)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment