@@ -900,10 +900,26 @@ static int gd_map_keycode(GtkDisplayState *s, GdkDisplay *dpy, int gdk_keycode)
#ifdef GDK_WINDOWING_WIN32
if (GDK_IS_WIN32_DISPLAY(dpy)) {
- qemu_keycode = MapVirtualKey(gdk_keycode, MAPVK_VK_TO_VSC);
- switch (qemu_keycode) {
- case 103: /* alt gr */
- qemu_keycode = 56 | SCANCODE_GREY;
+ /*
+ testing for right ctrl and right alt and give corresponding code.
+ for all other keystrokes, scan code is given by MapVirtualKey.
+ (MapVirtualKey maps same code for left and right ctrl and alt keys)
+ */
+ switch (gdk_keycode) {
+ case 0xa3: // r-ctrl
+ qemu_keycode = 0x9d;
+ break;
+ case 0xa5: // r-alt
+ qemu_keycode = 0xb8;
+ break;
+ default:
+ qemu_keycode = MapVirtualKey(gdk_keycode, MAPVK_VK_TO_VSC);
+ /* FIXME: is following check still needed? */
+ switch (qemu_keycode) {
+ case 103: /* alt gr */
+ qemu_keycode = 56 | SCANCODE_GREY;
+ break;
+ }
break;
}
return qemu_keycode;