[Spice-devel] [PATCH spice-gtk] win32: translate virtual-key code to scancode via MapVirtualKey
Daniel P. Berrange
berrange at redhat.com
Tue Oct 30 05:05:10 PDT 2012
On Tue, Oct 30, 2012 at 12:20:09PM +0100, Marc-André Lureau wrote:
> Local client keyboard layout shouldn't affect hardware scancode sent
> to guest, so that guest keyboard layout configuration can map it
> properly.
>
> Unfortunately, the Win32 GdkEventKey.hardware_keycode isn't a hardware
> scancode, but the Windows virtual-key code. We could modify Gdk to
> return the scancode (available in MSG.lParam or via global hook), but
> that would mean some Gdk breakage, or some unnecessary complexity.
> Instead, we can rely on MapVirtualKey(), which translates the
> vitual-key code into a scan code using current keyboard layout.
Hmm, I'm a little confused about this. The keyboard map we're using
should already be using Windows virtual-key codes as the source map,
so doing the right thing here. What you're doing here is just skipping
our keyboard maps competely which is not right IMHO.
I think the right thing is to just fix whatever mistake we have in
our keyboard maps, not avoid them.
Daniel
More information about the Spice-devel
mailing list