qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Oates <andrew@aoates.org>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Andrew Oates <andrew@aoates.org>
Subject: [Qemu-devel] [PATCH] input (curses): mask keycodes to remove modifier bits
Date: Fri, 23 May 2014 20:16:09 -0400	[thread overview]
Message-ID: <1400890569-30822-1-git-send-email-andrew@aoates.org> (raw)

Without the mask, control bits are passed on in the keycode, generating
incorrect PS/2 sequences when SHIFT, ALT, etc are held down.

Signed-off-by: Andrew Oates <andrew@aoates.org>
---
 ui/curses.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/curses.c b/ui/curses.c
index b044790..de85f76 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -288,8 +288,8 @@ static void curses_refresh(DisplayChangeListener *dcl)
                 qemu_input_event_send_key_number(NULL, GREY | ALT_CODE, true);
             }
 
-            qemu_input_event_send_key_number(NULL, keycode, true);
-            qemu_input_event_send_key_number(NULL, keycode, false);
+            qemu_input_event_send_key_number(NULL, keycode & KEY_MASK, true);
+            qemu_input_event_send_key_number(NULL, keycode & KEY_MASK, false);
 
             if (keycode & ALTGR) {
                 qemu_input_event_send_key_number(NULL, GREY | ALT_CODE, false);
-- 
1.9.3

             reply	other threads:[~2014-05-24  0:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-24  0:16 Andrew Oates [this message]
2014-05-24  7:02 ` [Qemu-devel] [PATCH] input (curses): mask keycodes to remove modifier bits Michael Tokarev
2014-05-26  7:51   ` Gerd Hoffmann

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=1400890569-30822-1-git-send-email-andrew@aoates.org \
    --to=andrew@aoates.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.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: link
Be 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 NNTP newsgroup(s).