qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Benjamin Drung <bdrung@ubuntu.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] wrong behaviour of caps lock
Date: Sat, 17 Apr 2010 11:59:48 +0200	[thread overview]
Message-ID: <4BC98694.6080504@mail.berlios.de> (raw)
In-Reply-To: <1270224121.12075.6.camel@deep-thought>

Benjamin Drung schrieb:
> Hi,
>
> We applied the attached patch in Ubuntu to fix the wrong behavior of
> caps lock.
>
> Initial bug report: https://launchpad.net/bugs/427612
>
> Testcase: Select German NEO 2 as keyboard layout and press "caps lock" +
> "l". Then a "-" should appear instead of a "t".

>From bb212d2b23bee1abe52db53231caccc1a6a27791 Mon Sep 17 00:00:00 2001
From: Shahar Havivi <shaharh@redhat.com>
Date: Fri, 12 Feb 2010 00:00:44 +0200
Subject: [PATCH] Qemu does not pass pressed capslock to client

---
sdl.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/sdl.c b/sdl.c
index cf27ad2..9074641 100644
--- a/sdl.c
+++ b/sdl.c
@@ -390,9 +390,11 @@ 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;
}

-- 
1.6.3.3

Hi,

I can confirm that caps lock shows wrong behavior in
the vga console. It works in monitor and serial console.

The patch improves the wrong behavior for vga
without changing the behavior for monitor and serial
console.

Nevertheless, some problems remain:

* The patch does not apply cleanly to current git master.

* Macro SCANCODE_UP should be used instead of 0x80.
  (That's already a problem in the current code).

* Removing the special cases for num lock and caps lock
  and the related code has the same effect as the patch
  (and is therefor the better solution).

Even with the patch applied, there remains an additional
problem:

QEMU changes num lock / caps lock states only when the
key is pressed / released while QEMU's sdl windows has
the input focus.

Users expect that any application window respects the
systems num lock / caps lock state, so we still need a
patch which synchronizes QEMU's state with the host's
state in any case - even without input focus.

Regards,
Stefan

  reply	other threads:[~2010-04-17  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02 16:02 [Qemu-devel] wrong behaviour of caps lock Benjamin Drung
2010-04-17  9:59 ` Stefan Weil [this message]
2010-04-19  1:23 ` Jamie Lokier
2010-04-19  8:38   ` Kevin Wolf
2010-04-19 16:07     ` Stefan Weil
2010-11-18 23:58       ` Benjamin Drung

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=4BC98694.6080504@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=bdrung@ubuntu.com \
    --cc=qemu-devel@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).