qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Andrew Oates <andrew@aoates.org>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] input (curses): mask keycodes to remove modifier bits
Date: Sat, 24 May 2014 11:02:05 +0400	[thread overview]
Message-ID: <538043ED.20200@msgid.tls.msk.ru> (raw)
In-Reply-To: <1400890569-30822-1-git-send-email-andrew@aoates.org>

24.05.2014 04:16, Andrew Oates wrote:
> Without the mask, control bits are passed on in the keycode, generating
> incorrect PS/2 sequences when SHIFT, ALT, etc are held down.

While the patch itself appears to be trivial, it may have
non-trivial effect.  Cc'ing Gerd for comments.

Thank you!

/mjt

> 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);
> 

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-24  0:16 [Qemu-devel] [PATCH] input (curses): mask keycodes to remove modifier bits Andrew Oates
2014-05-24  7:02 ` Michael Tokarev [this message]
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=538043ED.20200@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=andrew@aoates.org \
    --cc=kraxel@redhat.com \
    --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).