From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 001973888C4E; Fri, 18 Mar 2022 23:50:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 001973888C4E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Ignore dwControlKeyState in event comparison. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/cygwin-3_3-branch X-Git-Oldrev: 8f31cda1af64dee07f4aad4382758a756209132b X-Git-Newrev: 5f10ebc0a76633066bd30c89b715692d68e19f9f Message-Id: <20220318235014.001973888C4E@sourceware.org> Date: Fri, 18 Mar 2022 23:50:13 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2022 23:50:14 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D5f10ebc0a76= 633066bd30c89b715692d68e19f9f commit 5f10ebc0a76633066bd30c89b715692d68e19f9f Author: Takashi Yano Date: Sat Mar 19 08:43:24 2022 +0900 Cygwin: console: Ignore dwControlKeyState in event comparison. =20 - 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_con= sole.cc index 16850aebb..1bfe05a99 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 =3D 0; i < n; i++) { if (a[i].EventType =3D=3D KEY_EVENT && b[i].EventType =3D=3D KEY_EVE= NT) - { /* 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 =3D &a[i].Event.KeyEvent; const KEY_EVENT_RECORD *bk =3D &b[i].Event.KeyEvent; if (ak->bKeyDown !=3D bk->bKeyDown || ak->uChar.UnicodeChar !=3D bk->uChar.UnicodeChar - || ak->dwControlKeyState !=3D bk->dwControlKeyState || ak->wRepeatCount !=3D bk->wRepeatCount) return false; }