SL-14977 Fix passing wrong codes to ToUnicodeEx

meow-7.2.2
Andrey Kleshchev 2021-10-19 20:42:01 +03:00
parent e45d695cc8
commit b078daf4d2
1 changed files with 2 additions and 1 deletions

View File

@ -2916,7 +2916,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// ToUnicodeEx changes buffer state on OS below Win10, which is undesirable,
// but since we already did a TranslateMessage() in gatherInput(), this
// should have no negative effect
int res = ToUnicodeEx(key, 0, keyboard_state, chars, char_count, 1 << 2 /*do not modify buffer flag*/, layout);
// ToUnicodeEx works with virtual key codes
int res = ToUnicodeEx(raw_key, 0, keyboard_state, chars, char_count, 1 << 2 /*do not modify buffer flag*/, layout);
if (res == 1 && chars[0] >= 0x20)
{
// Let it fall through to character handler and get a WM_CHAR.