[PATCH xkbcomp] keycodes: Ignore high keycodes
Daniel Stone
daniel at fooishbar.org
Thu Apr 6 19:14:35 UTC 2017
Hi Ran,
On 6 April 2017 at 19:57, Ran Benita <ran234 at gmail.com> wrote:
> On Thu, Apr 06, 2017 at 05:37:28PM +0100, Daniel Stone wrote:
>> Rather than throwing a fatal error when a keycode definition exceeds the
>> declared maximum (i.e. 255), just ignore the definition and continue.
>>
>> This allows xkeyboard-config to start shipping datasets including high
>> keycodes, which will work in xkbcommon as it ignores explicit range
>> declarations.
>
> 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.
> 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
...
Cheers,
Daniel
More information about the xorg-devel
mailing list