[Spice-devel] [patch 1/3] spice-server: add SpiceMsgcKeyX11KeySym protocol message definition

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


On Fri, Oct 11, 2013 at 2:45 PM,  <dietmar at proxmox.com> wrote:
> And introduce a new capability SPICE_INPUTS_CAP_KEY_X11_KEYSYM.
>
> The new message includes a x11 keysym, the scancode, and a flag
> to indicate if a key is pressed or released (or both).
>
>      message {
>        uint32 keysym;
>        keyboard_flags flags;
>        uint8 code_len;
>        uint8 code[code_len] @end;

What spice server would use both scancode and keysym at the same time?
Why can't we keep existing events for scancode and add another event
for keysym? The protocol could ensure that after keysym comes the
scancode, if the server requests that behaviour, as a future
extension. No need to overlap messages, no need for unnecessary
overhead.

>      } @ctype(SpiceMsgcKeyX11KeySym) key_x11_keysym;
>
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
>
> Index: new/spice-common/common/client_marshallers.h
> ===================================================================
> --- new.orig/spice-common/common/client_marshallers.h   2013-10-11 09:26:28.000000000 +0200
> +++ new/spice-common/common/client_marshallers.h        2013-10-11 09:26:33.000000000 +0200
> @@ -48,6 +48,7 @@
>      void (*msgc_inputs_key_down)(SpiceMarshaller *m, SpiceMsgcKeyDown *msg);
>      void (*msgc_inputs_key_up)(SpiceMarshaller *m, SpiceMsgcKeyUp *msg);
>      void (*msgc_inputs_key_modifiers)(SpiceMarshaller *m, SpiceMsgcKeyModifiers *msg);
> +    void (*msgc_inputs_key_x11_keysym)(SpiceMarshaller *m, SpiceMsgcKeyX11KeySym *msg);
>      void (*msgc_inputs_mouse_motion)(SpiceMarshaller *m, SpiceMsgcMouseMotion *msg);
>      void (*msgc_inputs_mouse_position)(SpiceMarshaller *m, SpiceMsgcMousePosition *msg);
>      void (*msgc_inputs_mouse_press)(SpiceMarshaller *m, SpiceMsgcMousePress *msg);
> Index: new/spice-common/common/messages.h
> ===================================================================
> --- new.orig/spice-common/common/messages.h     2013-10-11 09:26:28.000000000 +0200
> +++ new/spice-common/common/messages.h  2013-10-11 10:52:08.000000000 +0200
> @@ -417,6 +417,13 @@
>      uint32_t modifiers;
>  } SpiceMsgcKeyModifiers;
>
> +typedef struct SpiceMsgcKeyX11KeySym {
> +    uint32_t keysym;
> +    uint32_t flags;
> +    uint8_t code_len;
> +    uint8_t code[0];
> +} SpiceMsgcKeyX11KeySym;
> +
>  typedef struct SpiceMsgcMouseMotion {
>      int32_t dx;
>      int32_t dy;
> Index: new/spice-common/spice.proto
> ===================================================================
> --- new.orig/spice-common/spice.proto   2013-10-11 09:26:28.000000000 +0200
> +++ new/spice-common/spice.proto        2013-10-11 10:53:29.000000000 +0200
> @@ -938,6 +938,11 @@
>      RIGHT
>  };
>
> +flags32 keyboard_flags {
> +    DOWN,
> +    UP,
> +} @prefix(SPICE_KEYBOARD_FLAG_);
> +
>  channel InputsChannel : BaseChannel {
>   client:
>      message {
> @@ -955,6 +960,13 @@
>      Data key_scancode;
>
>      message {
> +       uint32 keysym;
> +       keyboard_flags flags;
> +       uint8 code_len;
> +       uint8 code[code_len] @end;
> +   } @ctype(SpiceMsgcKeyX11KeySym) key_x11_keysym;
> +
> +    message {
>         int32 dx;
>         int32 dy;
>         mouse_button_mask buttons_state;
> Index: new/spice-common/spice-protocol/spice/protocol.h
> ===================================================================
> --- new.orig/spice-common/spice-protocol/spice/protocol.h       2013-10-11 09:26:28.000000000 +0200
> +++ new/spice-common/spice-protocol/spice/protocol.h    2013-10-11 09:26:33.000000000 +0200
> @@ -135,6 +135,7 @@
>
>  enum {
>      SPICE_INPUTS_CAP_KEY_SCANCODE,
> +    SPICE_INPUTS_CAP_KEY_X11_KEYSYM,
>  };
>
>  enum {
>
> _______________________________________________
> 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