diff options
Diffstat (limited to 'app/xkbcomp/keycodes.c')
-rw-r--r-- | app/xkbcomp/keycodes.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/xkbcomp/keycodes.c b/app/xkbcomp/keycodes.c index d5ac762a5..c21f7c452 100644 --- a/app/xkbcomp/keycodes.c +++ b/app/xkbcomp/keycodes.c @@ -663,7 +663,7 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info) ACTION1("Assignment to field %s ignored\n", field.str); return 0; } - if ((tmp.ival < XkbMinLegalKeyCode) || (tmp.ival > XkbMaxLegalKeyCode)) + if ((tmp.ival < XkbMinLegalKeyCode)) { ERROR3 ("Illegal keycode %d (must be in the range %d-%d inclusive)\n", @@ -671,6 +671,14 @@ HandleKeyNameVar(VarDef * stmt, KeyNamesInfo * info) ACTION1("Value of \"%s\" not changed\n", field.str); return 0; } + if ((tmp.ival > XkbMaxLegalKeyCode)) + { + WARN2("Unsupported maximum keycode %d, clipping.\n", tmp.ival); + ACTION2("X11 cannot support keycodes above 255.\n"); + info->explicitMax = XkbMaxLegalKeyCode; + info->effectiveMax = XkbMaxLegalKeyCode; + return 1; + } if (which == MIN_KEYCODE_DEF) { if ((info->explicitMax > 0) && (info->explicitMax < tmp.ival)) |