diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-03-19 08:43:24 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-03-19 08:43:24 +0900 |
commit | 92519e3d0cd71a2ebce70e43e72d22cfee6945ab (patch) | |
tree | 3a066b4d7acb565af87935aff5fb3962294b5a7f | |
parent | 8d3271b7fa4ceed4825ce125123b75447ef18d53 (diff) | |
download | newlib-92519e3d0cd71a2ebce70e43e72d22cfee6945ab.zip newlib-92519e3d0cd71a2ebce70e43e72d22cfee6945ab.tar.gz newlib-92519e3d0cd71a2ebce70e43e72d22cfee6945ab.tar.bz2 |
Cygwin: console: Ignore dwControlKeyState in event comparison.
- dwControlKeyState also may be null'ed on WriteConsoleInputW().
Therefore ignore it in event comparison as well as wVirtualKeyCode
and wVirtualScanCode.
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 68248d1..fd5f972 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -187,13 +187,13 @@ inrec_eq (const INPUT_RECORD *a, const INPUT_RECORD *b, DWORD n) for (DWORD i = 0; i < n; i++) { if (a[i].EventType == KEY_EVENT && b[i].EventType == KEY_EVENT) - { /* wVirtualKeyCode and wVirtualScanCode of the readback - key event may be different from that of written event. */ + { /* wVirtualKeyCode, wVirtualScanCode and dwControlKeyState + of the readback key event may be different from that of + written event. Therefore they are ignored. */ const KEY_EVENT_RECORD *ak = &a[i].Event.KeyEvent; const KEY_EVENT_RECORD *bk = &b[i].Event.KeyEvent; if (ak->bKeyDown != bk->bKeyDown || ak->uChar.UnicodeChar != bk->uChar.UnicodeChar - || ak->dwControlKeyState != bk->dwControlKeyState || ak->wRepeatCount != bk->wRepeatCount) return false; } |