[前][次][番号順一覧][スレッド一覧]

ruby-changes:73488

From: YO4 <ko1@a...>
Date: Fri, 9 Sep 2022 00:46:21 +0900 (JST)
Subject: [ruby-changes:73488] 81e7573a64 (master): win32.c additional fix: is_readable_console

https://git.ruby-lang.org/ruby.git/commit/?id=81e7573a64

From 81e7573a64b0544da7172966b88e797033b1eae6 Mon Sep 17 00:00:00 2001
From: YO4 <ysno@a...>
Date: Sat, 3 Sep 2022 01:03:10 +0900
Subject: 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
---
 win32/win32.c | 5 +++++
 1 file changed, 5 insertions(+)

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 */ https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L3105
                 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);
             }
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]