[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Qemu does not pass pressed caps lock to client
From: |
Shahar Havivi |
Subject: |
Re: [Qemu-devel] Qemu does not pass pressed caps lock to client |
Date: |
Fri, 12 Feb 2010 13:09:03 +0200 |
It's not true that SDL is not sending up event like the comment say,
On Fedora 12 it behave like a toggle button, first press/release will send
caps-down event second press/release send caps-up event
On Ubuntu 9.10 it work like any other key, i.e. pressing caps will generate two
events down and up.
Shahar.
On Fri, Feb 12, 2010 at 11:54 AM, Kevin Wolf <address@hidden> wrote:
> 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 <address@hidden>
>>
>> ---
>> 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
>
- [Qemu-devel] Qemu does not pass pressed caps lock to client, Shahar Havivi, 2010/02/11
- Re: [Qemu-devel] Qemu does not pass pressed caps lock to client, Kevin Wolf, 2010/02/12
- Re: [Qemu-devel] Qemu does not pass pressed caps lock to client,
Shahar Havivi <=
- Re: [Qemu-devel] Qemu does not pass pressed caps lock to client, Kevin Wolf, 2010/02/12
- [Qemu-devel] Re: Qemu does not pass pressed caps lock to client, Paolo Bonzini, 2010/02/12
- Re: [Qemu-devel] Re: Qemu does not pass pressed caps lock to client, Anthony Liguori, 2010/02/12
- Re: [Qemu-devel] Re: Qemu does not pass pressed caps lock to client, Paolo Bonzini, 2010/02/12
- Re: [Qemu-devel] Re: Qemu does not pass pressed caps lock to client, Anthony Liguori, 2010/02/12
- Re: [Qemu-devel] Re: Qemu does not pass pressed caps lock to client, Dustin Kirkland, 2010/02/12
- [Qemu-devel] Re: Qemu does not pass pressed caps lock to client, Paolo Bonzini, 2010/02/13