[Spice-devel] [PATCH spice-protocol] vdagent: add keyboard description message
Pavel Grunt
pgrunt at redhat.com
Mon Nov 3 01:05:26 PST 2014
> ----- Original Message -----
> > The message will be used for transferring the keyboard layout
> > from the client to the guest. When the agent receives this message,
> > it tries to set the specified keyboard layout.
> >
> > https://bugs.freedesktop.org/show_bug.cgi?id=85332
> > ---
> > VDAgentMessage will be used for the transfer, the type of the
> > message depends
> > on a client.
> > Linux clients use VD_AGENT_KEYBOARD_DESCRIPTION_XKB,
> > windows clients use VD_AGENT_KEYBOARD_DESCRIPTION_WINDOWS.
>
> Can you be more explicit about the content of the message? How do you
> transfer the keyboard layout?
>
xkb client: the content is a string having information similar like running 'setxkbmap -print'.
windows client: the content is based on GetKeyboardLayoutName function which returns
a device identifier and a language identifier (eg 0x0409 for us english).
> It sounds wrong that the guest agent will have to accommodate with
> two kinds of descriptions. It would make more sense to me for the
> protocol to define one description (presumably xkb), and make the
> client and agent use that only, as it should reduce the complexity.
> Perhaps you have good reasons to have two kind of descriptions
> possible?
Some conversions between xkb and windows definitions are possible, but I wanted
to have more precise behavior when the client and the guest are running the same OS.
>
> > ---
> > spice/vd_agent.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/spice/vd_agent.h b/spice/vd_agent.h
> > index 7464661..79cc39d 100644
> > --- a/spice/vd_agent.h
> > +++ b/spice/vd_agent.h
> > @@ -77,6 +77,7 @@ enum {
> > VD_AGENT_FILE_XFER_DATA,
> > VD_AGENT_CLIENT_DISCONNECTED,
> > VD_AGENT_MAX_CLIPBOARD,
> > + VD_AGENT_KEYBOARD_DESCRIPTION,
> > VD_AGENT_END_MESSAGE,
> > };
> >
> > @@ -245,6 +246,11 @@ typedef struct SPICE_ATTR_PACKED
> > VDAgentAnnounceCapabilities {
> > #define VD_AGENT_SET_CAPABILITY(caps, index) \
> > { (caps)[(index) / 32] |= (1 << ((index) % 32)); }
> >
> > +enum {
> > + VD_AGENT_KEYBOARD_DESCRIPTION_XKB,
> > + VD_AGENT_KEYBOARD_DESCRIPTION_WINDOWS,
> > +};
> > +
> > #include <spice/end-packed.h>
> >
> > #endif /* _H_VD_AGENT */
> > --
> > 1.9.3
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> >
>
More information about the Spice-devel
mailing list