[Spice-devel] [patch 0/6] X11 KEYSYM input channel extension v2

dietmar at proxmox.com dietmar at proxmox.com
Wed Oct 16 07:15:59 CEST 2013


This version adds code to directly forward keysmys to vdagent, which then
tries to inject keysyms into X11.

That way you always have correct input characters even if VM and
client do not share the same keymap!

Experiemts showed that is quite useful, but very difficult to
implement correctly with current X11/linux.

I just send this to the list to archive the work I have done so far.
Marc already expressed that he do like the current patches, so I will
rewrite them and post v3 soon.

Description from v1:

The SPICE input channel currently only sends scancodes. Thus the
server does not know what character was pressed (server does not know
the client keymap).

But Some SPICE applications want to use the keymap from the client
side, and work directly with UTF input characters (for example the
'spiceterm' terminal emulator). The current scancode values cannot be
used for such applications.

Unfortunately, we cannot use UTF directly, because the UTF character
set miss all special keyboard keys like function-keys. So this patch
uses X11/gdk keyboard symbols (keysyms) instead (VNC clients also use
that, so this makes it easy to move from VNC to SPICE). Many frameworks
provide functions to translate keysyms to unicode
(gdk_keyval_to_unicode, XKeySymToWideChar, ...)

Another use case for this protocol extension is to generate scancodes
at server side. This is useful when there is no way to get scancodes on
the client side (HTML5/javascript/java clients). Qemu already has code
to do that with the VNC input channel, so it would be easy to reuse
that code.

Changelog for v2:

* fix compiler warnings

* add code to directly forward keysmys to vdagent, which then
  tries to inject keysyms into X11.



More information about the Spice-devel mailing list