[virt-tools-list] Possible fix for Missing Characters @ (Alt-GR Q) and | (Alt-GR <) on german locale

Marc-André Lureau mlureau at redhat.com
Mon May 13 11:38:26 UTC 2013


Hi Mattias,

I think your solution is best for now, as it discriminates the fake event. However, it will not filter out events when the widget doesn't have the keyboard grab.
Could you send a git patch anyway?

It would be nice to have this solved at gdk level, instead of each application having a global hook, but then WH_KEYBOARD_LL is too low-level, and I wonder if WH_KEYBOARD can be sufficient...

----- Mensaje original -----
> Hi
> 
> ----- Mensaje original -----
> > Running virt-viewer-x64-0.5.6.msi, on Windows 7, connecting to QEMU using
> > spice, AltGR key combinations fails (using Swedish keyboard layout both at
> > server and client).
> > 
> > I suspect that this is a variant of
> > https://bugzilla.redhat.com/show_bug.cgi?id=904092 .
> > 
> 
> and https://bugzilla.redhat.com/show_bug.cgi?id=956686
> 
> > After some debugging, I realized that there is an extra VK_LCONTROL
> > keypress
> > sent by Windows. This extra VK_LCONTROL will then make the key e.g. AltGr-<
> > actually be Control-AltGr-<, which is not interpreted as a | sign.
> > 
> > So in spice-widget.c : keyboard_hook_cb(), I added SPICE_DEBUG lines which
> > printed out the hooked->scanCode, and realized that this extra VK_LCONTROL
> > has a very suspect scanCode with bit 9 set. If I instead press the left
> > Ctrl
> > key, it will also emit VK_LCONTROL, but with bit 9 cleared.
> 
> Funny, I haven't noticed that bit 9 difference. And neither Xwin people. I
> proposed a Gdk patch similar to Xwin approach:
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=699787
> 
> > So I just made sure that keyboard_hook_cb(), silently dropped these strange
> > VK_LCONTROL events, which seems to work for me.
> > 
> > 
> > case VK_NUMLOCK:
> > case VK_LSHIFT:
> > case VK_RSHIFT:
> > - case VK_LCONTROL:
> > case VK_RCONTROL:
> > case VK_LMENU:
> > case VK_RMENU:
> > break;
> > + case VK_LCONTROL:
> > + // When pressing AltGr, an extra VK_LCONTROL with a special scancode with
> > bit 9 set is sent.
> > + // Lets ignore the extra VK_LCONTROL, as that will make AltGr missbehave.
> > + if (hooked->scanCode & 0x200)
> > + return 1;
> > + break;
> > default:
> > SendMessage(win32_window, wparam, hooked->vkCode, dwmsg);
> > return 1;
> > }
> 
> It looks like a good solution too, especially if we can't fix it in gdk.
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 




More information about the virt-tools-list mailing list