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

dietmar at proxmox.com dietmar at proxmox.com
Fri Oct 11 14:45:37 CEST 2013


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.

As noted above, 'spiceterm' uses this extension. Code is available here:

https://git.proxmox.com/?p=spiceterm.git;a=summary

'spiceterm' is a full featured terminal emulator and exports the display
using the SPICE protocol. 

Features: 

* xterm/linux compatible
* cut and paste (vdagent)
* screen resize (vdagent)

Example usage:

By default we start a simple shell (/bin/sh)

# ./spiceterm & remote-viewer spice://localhost:5912

You can also specify the program to execute, for example a login screen

# ./spiceterm -c /bin/login & remote-viewer spice://localhost:5912

Or enter a OpenVZ container console

# ./spiceterm -c vzctl enter 100  & remote-viewer spice://localhost:5912



More information about the Spice-devel mailing list