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

Marc-André Lureau marcandre.lureau at gmail.com
Tue Oct 15 15:29:50 CEST 2013


Hi

On Fri, Oct 11, 2013 at 2:45 PM,  <dietmar at proxmox.com> wrote:
> 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).

correct, by design.

> 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.

That's not a good reason, It can, just like XSpice or weston-spice...

The reason is spiceterm wants the same key symbol as the client, to
avoid hw keyboard mapping.

> 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, ...)

We could use utf8 directly, by combining utf8 for symbols, and
scancode for other keyboard events.

> 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.

The problem is not to translate html key events to scancode (this
could easily be done in js too), but to get real hw scancode, to avoid
getting mapped keyboard events from client.

> 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.

This introduction deserved a seperate mail.

> 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
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel



-- 
Marc-André Lureau


More information about the Spice-devel mailing list