[PATCH xkbcomp] keycodes: Ignore high keycodes

Daniel Stone daniels at collabora.com
Thu Apr 6 16:37:28 UTC 2017


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.

Signed-off-by: Daniel Stone <daniels at collabora.com>
Reported-by: Christian Kellner <gicmo at gnome.org>
---
 keycodes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/keycodes.c b/keycodes.c
index 22d9eae..e692bf7 100644
--- a/keycodes.c
+++ b/keycodes.c
@@ -330,10 +330,10 @@ AddKeyName(KeyNamesInfo * info,
 
     if ((kc < info->effectiveMin) || (kc > info->effectiveMax))
     {
-        ERROR2("Illegal keycode %d for name <%s>\n", kc, name);
+        WARN2("Illegal keycode %d for name <%s>\n", kc, name);
         ACTION2("Must be in the range %d-%d inclusive\n",
                 info->effectiveMin, info->effectiveMax);
-        return False;
+        return True;
     }
     if (kc < info->computedMin)
         info->computedMin = kc;
@@ -589,10 +589,10 @@ HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info)
     code = result.ival;
     if ((code < info->effectiveMin) || (code > info->effectiveMax))
     {
-        ERROR2("Illegal keycode %d for name <%s>\n", code, stmt->name);
+        WARN2("Illegal keycode %d for name <%s>\n", code, stmt->name);
         ACTION2("Must be in the range %d-%d inclusive\n",
                 info->effectiveMin, info->effectiveMax);
-        return 0;
+        return 1;
     }
     if (stmt->merge != MergeDefault)
     {
-- 
2.12.2



More information about the xorg-devel mailing list