public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: console: Ignore dwControlKeyState in event comparison.
@ 2022-03-18 23:50 Takashi Yano
  0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2022-03-18 23:50 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=92519e3d0cd71a2ebce70e43e72d22cfee6945ab

commit 92519e3d0cd71a2ebce70e43e72d22cfee6945ab
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Sat Mar 19 08:43:24 2022 +0900

    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.

Diff:
---
 winsup/cygwin/fhandler_console.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 68248d16c..fd5f972d8 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;
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-18 23:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 23:50 [newlib-cygwin] Cygwin: console: Ignore dwControlKeyState in event comparison Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).