[PATCH xkbcomp] keycodes: Ignore high keycodes

Ran Benita ran234 at gmail.com
Thu Apr 6 19:24:10 UTC 2017


On Thu, Apr 06, 2017 at 08:14:35PM +0100, Daniel Stone wrote:
> On 6 April 2017 at 19:57, Ran Benita <ran234 at gmail.com> wrote:
> > I always hoped that Wayland systems could switch to a new keycode file,
> > which uses the full evdev key names (xkbcommon no longer has the 4
> > character limit), and the evdev codes (without the + 8 offset), and
> > aliases for backward compat with existing keymaps. But I guess that
> > would be a lot of pain for little gain.
> 
> Yeah, me too. But by the time we'd encoded the +8 offset in enough
> clients, that boat had already sailed, unfortunately.

Yeah.

> > So this seems like a good idea to me, to move things forward.
> >
> > My only concern about the patch is that I think that it will issue a
> > million warnings if keymaps start to use this? I looked at utils.c (a
> > true relic) and it seems that there is no filtering on these ERROR2 and
> > ACTION2, they just print. Add to that other files which would start to
> > use the new keycodes, and you get more warnings (hopefully not fatal
> > errors).
> >
> > I think a reasonable test plan would be:
> >
> > - Add ~15 new >255 keycodes.
> > - Use them in some symbols file.
> > - Try to load this with a patched xkbcomp.
> > - See that:
> >   - There's not a huge log spam.
> >   - That it actually doesn't fail.
> >
> > Note that I say ~15, because I vaguely remember that there are "allow 10
> > errors then give up" checks in some places.
> 
> Funnily, that's exactly what I did. And yeah, it does spam a lot more
> warnings, but there are already 46 lines of warnings spat out by
> xkbcomp just building a plain evdev/us keymap. I made sure that
> they're not errors though, so the number doesn't matter. Just to be
> doubly safe, I bumped it up to 16 new keycodes, and it worked fine,
> warnings notwithstanding. I could tune the WARNs down to INFO, but it
> already warns for things like no symbols defined for a given key, so
> ...

Good enough for me!

I think we should first hear if Sergey would even accept >255 keycodes
in xkeyboard-config keymaps which are shared with X11 (once this patch
is applied and sufficient time has passed). But regardless:

Reviewed-by: Ran Benita <ran234 at gmail.com>

Ran


More information about the xorg-devel mailing list