From 7be0aa2f9f7f7ea6106a638e5ab6815f3c36db17 Mon Sep 17 00:00:00 2001 From: Oleksii Milevskyi Date: Tue, 3 Dec 2024 18:29:50 +0200 Subject: [PATCH] WinPort/src/ConsoleInput.cpp: fix crash when dot is pressed in cyrillic layout --- WinPort/src/ConsoleInput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WinPort/src/ConsoleInput.cpp b/WinPort/src/ConsoleInput.cpp index 545db2f73..45ceee5a9 100644 --- a/WinPort/src/ConsoleInput.cpp +++ b/WinPort/src/ConsoleInput.cpp @@ -304,7 +304,7 @@ void ConsoleInput::Enqueue(const INPUT_RECORD *data, DWORD size) const auto uni = data[i].Event.KeyEvent.uChar.UnicodeChar; fprintf(stderr, "ConsoleInput::Enqueue: %s %s \"%lc\" %s, %x %x %x %x\n", FormatKeyState(data[i].Event.KeyEvent.dwControlKeyState), - VirtualKeyNames[data[i].Event.KeyEvent.wVirtualKeyCode], + data[i].Event.KeyEvent.wVirtualKeyCode < sizeof(VirtualKeyNames) / sizeof(const char*) ? VirtualKeyNames[data[i].Event.KeyEvent.wVirtualKeyCode] : "0x00", (uni && (uni > 0x1f)) ? uni : L'?', data[i].Event.KeyEvent.bKeyDown ? "DOWN" : "UP",