[PATCH] protocol: Document how clients are supposed to get the xkb keycode

Kristian Høgsberg hoegsberg at gmail.com
Tue Apr 1 16:42:42 PDT 2014


On Tue, Mar 25, 2014 at 04:35:39PM +0100, Rui Matos wrote:
> This encodes what everyone is doing and avoids other implementers
> having to guess.
> ---
> 
> Jasper suggested that it would be nice if the compositor sent keycodes
> that clients could use directly as an index in the keymap. I suppose
> we can't do that at this point so we should at least document it
> clearly in the protocol so that implementers don't have to guess.

Yeah, we can't change that because the whole point of libxkbcommon is to
reuse xkb keymaps and they have a minimum keycode or 8.  Wayland on the
other hand just sends raw evdev keycodes.

This goes back to the X keymap notify event, which is a 32 byte message
with the first 8 bits identifying the event and the remaining 248 bits
being a bit vector of currently pressed keys.  As such the first 8 keycodes
can't be used since they'd overlap with the event id byte.

Kristian

> 
> 
>  protocol/wayland.xml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/protocol/wayland.xml b/protocol/wayland.xml
> index 3aa89af..db1b349 100644
> --- a/protocol/wayland.xml
> +++ b/protocol/wayland.xml
> @@ -1503,7 +1503,8 @@
>        </description>
>        <entry name="no_keymap" value="0"
>  	     summary="no keymap; client must understand how to interpret the raw keycode"/>
> -      <entry name="xkb_v1" value="1" summary="libxkbcommon compatible"/>
> +      <entry name="xkb_v1" value="1"
> +             summary="libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode"/>
>      </enum>
>  
>      <event name="keymap">
> -- 
> 1.9.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list