summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorYO4 <ysno@ac.auone-net.jp>2022-09-03 01:03:10 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-09-09 00:45:56 +0900
commit81e7573a64b0544da7172966b88e797033b1eae6 (patch)
tree1f70c31ed1f3162cccc390ec412ea3f0ec7f5ce9 /win32
parent7a849e1903f3943351773190a1e39e0445b55204 (diff)
downloadruby-81e7573a64b0544da7172966b88e797033b1eae6.tar.gz
win32.c additional fix: is_readable_console
classic console(conhost.exe) reports an input with ALT+NUMPAD as VK_MENU, KeyUp, and uChar!=0. additional fix for #5634
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 6f1ee51206..24990a00d3 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3105,6 +3105,11 @@ is_readable_console(SOCKET sock) /* call this for console only */
ir.Event.KeyEvent.uChar.UnicodeChar) {
ret = 1;
}
+ else if (ir.EventType == KEY_EVENT && !ir.Event.KeyEvent.bKeyDown &&
+ ir.Event.KeyEvent.wVirtualKeyCode == 18 /* VK_MENU */ &&
+ ir.Event.KeyEvent.uChar.UnicodeChar) {
+ ret = 1;
+ }
else {
ReadConsoleInputW((HANDLE)sock, &ir, 1, &n);
}