[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] quick gtk2.c update

From: Jim C. Brown
Subject: Re: [Qemu-devel] quick gtk2.c update
Date: Wed, 22 Jun 2005 09:22:38 -0400
User-agent: Mutt/1.4i

On Tue, Jun 21, 2005 at 07:58:14PM -0400, Jim C. Brown wrote:
> Well, no, that isn't it. The keymap files are based on X11 keycodes, so even 
> if
> you could use this option it wouldn't work at all.

More digging around in sdl.c revealed that SDL on Linux returns X11 keycodes
as GTK on Linux does, while on Windows SDL returns the raw scan code.

> I know the offending function. This is the culprit:
> static uint8_t gtk2_keyevent_to_keycode(const GdkEventKey *ev)
> Apparently, that does not work for win32 gtk.
> In fact, that is apparently the Windows virtual key code, not the raw 
> scancode.
> Hence the funny characters. The good news is that this is an easy fix.

I've cleaned up the code a little bit, and attached a new gtk2.c to this email.

> What I really need is a Win32
> programmer to proofread this, make sure I got it right.

Since no Win32 person on this list or in the qemu irc channel offered to help 
I can not even guarrentee this will compile. And if it does compile, it is 
that keys will not work right due to lost of information due to casting (this is
unlikely as all scancodes can be represented as a single byte, and it seems all
Windows virtual key codes can be represented in at least two bytes).

Still, I work with what I have to go on. Try this gtk2.c and report any errors
(be they compile errors or runtime errors or keyboard problems). Your help is
always greatly appreciated.

Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

Attachment: gtk2.c
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]