public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Takashi Yano <tyan0@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Ignore dwControlKeyState in event comparison. Date: Fri, 18 Mar 2022 23:50:13 +0000 (GMT) [thread overview] Message-ID: <20220318235014.001973888C4E@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5f10ebc0a76633066bd30c89b715692d68e19f9f commit 5f10ebc0a76633066bd30c89b715692d68e19f9f 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 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 = 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; }
reply other threads:[~2022-03-18 23:50 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220318235014.001973888C4E@sourceware.org \ --to=tyan0@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).