From: Kevin Wolf <kwolf@redhat.com>
To: Shahar Havivi <shaharh@gmail.com>
Cc: qemu-devel@nongnu.org, bdrung@ubuntu.com
Subject: Re: [Qemu-devel] Qemu does not pass pressed caps lock to client
Date: Fri, 12 Feb 2010 10:54:16 +0100 [thread overview]
Message-ID: <4B752548.1040108@redhat.com> (raw)
In-Reply-To: <b0ae6fcc1002111313j56b57aa4tb90a7697d8877283@mail.gmail.com>
Am 11.02.2010 22:13, schrieb Shahar Havivi:
> Qemu have a hack for capslock that is not working with Ubuntu.
> attached patch that fix it, as describe in this bug:
> https://bugs.launchpad.net/qemu/+bug/427612
>
> Signed-off-by: Shahar Havivi <shaharh@gmail.com>
>
> ---
> sdl.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/sdl.c b/sdl.c
> index cf27ad2..b3d5049 100644
> --- a/sdl.c
> +++ b/sdl.c
> @@ -390,9 +390,10 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
> break;
> case 0x45: /* num lock */
> case 0x3a: /* caps lock */
> - /* SDL does not send the key up event, so we generate it */
> - kbd_put_keycode(keycode);
> - kbd_put_keycode(keycode | 0x80);
> + if (ev->type == SDL_KEYUP)
> + kbd_put_keycode(keycode | 0x80);
> + else
> + kbd_put_keycode(keycode);
> return;
> }
>
The previous code explicitly says the SDL doesn't send the key up event.
If you think this is wrong generally, this definitely needs an
explanation in the commit message, Also it could use an explanation of
_why_ it doesn't work with Ubuntu - I assume they use either a newer or
a patched SDL version which does generate these events? As you did not
provide these explanations, I assume that this just happens to work for
your specific Ubuntu version and is wrong for some other systems.
What about always generating both keycodes as we currently do, but
ignoring the event if ev->type == SDL_KEYUP? This should work with any
SDL version.
Kevin
next prev parent reply other threads:[~2010-02-12 9:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-11 21:13 [Qemu-devel] Qemu does not pass pressed caps lock to client Shahar Havivi
2010-02-12 9:54 ` Kevin Wolf [this message]
2010-02-12 11:09 ` Shahar Havivi
2010-02-12 11:43 ` Kevin Wolf
2010-02-12 12:39 ` [Qemu-devel] " Paolo Bonzini
2010-02-12 15:15 ` Anthony Liguori
2010-02-12 18:17 ` Paolo Bonzini
2010-02-12 18:44 ` Anthony Liguori
2010-02-12 20:49 ` Dustin Kirkland
2010-02-13 11:21 ` Paolo Bonzini
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=4B752548.1040108@redhat.com \
--to=kwolf@redhat.com \
--cc=bdrung@ubuntu.com \
--cc=qemu-devel@nongnu.org \
--cc=shaharh@gmail.com \
/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).