All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Anthony Liguori <aliguori@amazon.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] gtk: Support keyboard translation for hosts running Windows
Date: Sun, 19 Jan 2014 22:18:47 +0100	[thread overview]
Message-ID: <52DC4137.9030105@weilnetz.de> (raw)
In-Reply-To: <52D043C0.2010204@weilnetz.de>

Am 10.01.2014 20:02, schrieb Stefan Weil:
> Am 18.12.2013 19:14, schrieb Stefan Weil:
>> Am 07.12.2013 16:25, schrieb Stefan Weil:
>>> GTK uses different hardware keycodes on Windows hosts, so some special
>>> handling is needed to get the QEMU keycode.
>>>
>>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>>> ---
>>>  ui/gtk.c |   18 +++++++++++++++---
>>>  1 file changed, 15 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/ui/gtk.c b/ui/gtk.c
>>> index 6316f5b..a633d89 100644
>>> --- a/ui/gtk.c
>>> +++ b/ui/gtk.c
>>> @@ -34,6 +34,10 @@
>>>  #define GETTEXT_PACKAGE "qemu"
>>>  #define LOCALEDIR "po"
>>>  
>>> +#ifdef _WIN32
>>> +# define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
>>> +#endif
>>> +
>>>  #include "qemu-common.h"
>>>  
>>>  #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
>>> @@ -704,11 +708,18 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
>>>  static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
>>>  {
>>>      GtkDisplayState *s = opaque;
>>> -    int gdk_keycode;
>>> -    int qemu_keycode;
>>> +    int gdk_keycode = key->hardware_keycode;
>>>      int i;
>>>  
>>> -    gdk_keycode = key->hardware_keycode;
>>> +#ifdef _WIN32
>>> +    UINT qemu_keycode = MapVirtualKey(gdk_keycode, MAPVK_VK_TO_VSC);
>>> +    switch (qemu_keycode) {
>>> +    case 103:   /* alt gr */
>>> +        qemu_keycode = 56 | SCANCODE_GREY;
>>> +        break;
>>> +    }
>>> +#else
>>> +    int qemu_keycode;
>>>  
>>>      if (gdk_keycode < 9) {
>>>          qemu_keycode = 0;
>>> @@ -723,6 +734,7 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
>>>      } else {
>>>          qemu_keycode = 0;
>>>      }
>>> +#endif
>>>  
>>>      trace_gd_key_event(gdk_keycode, qemu_keycode,
>>>                         (key->type == GDK_KEY_PRESS) ? "down" : "up");
>>
>> Ping? Should I send a MinGW pull request for this patch?
>>
> 
> 
> Ping^2? I tried to answer Andreas' questions. Are there any more?
> 
> Stefan
> 


Ping^3. What is missing to get this patch applied? It was sent more than
a month ago (2012-12-07).

Stefan

  reply	other threads:[~2014-01-19 21:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 15:25 [Qemu-devel] [PATCH] gtk: Support keyboard translation for hosts running Windows Stefan Weil
2013-12-18 18:14 ` Stefan Weil
2014-01-10 19:02   ` Stefan Weil
2014-01-19 21:18     ` Stefan Weil [this message]
2014-01-20  9:52       ` Paolo Bonzini
2013-12-18 18:28 ` Andreas Färber
2013-12-18 20:12   ` Stefan Weil
2013-12-18 20:17     ` Stefan Weil

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=52DC4137.9030105@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.