Use our own keysyms

master
Kristian Høgsberg 2012-05-09 09:05:00 -04:00
parent c6897d2698
commit ace1e5df6d
13 changed files with 76 additions and 104 deletions

View File

@ -93,7 +93,7 @@ makekeys_makekeys_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
makekeys_makekeys_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) makekeys_makekeys_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
src/ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT) src/ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT)
$(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@ $(top_builddir)/makekeys/makekeys $(top_srcdir)/include/xkbcommon/xkbcommon-keysyms.h > $@
# Tests # Tests

View File

@ -85,6 +85,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbcommon/xkbcommon-keysyms.h> #include <xkbcommon/xkbcommon-keysyms.h>
#define XKB_KEY_NoSymbol 0L /* special KeySym */
typedef uint32_t xkb_keycode_t; typedef uint32_t xkb_keycode_t;
typedef uint32_t xkb_keysym_t; typedef uint32_t xkb_keysym_t;
typedef uint32_t xkb_mod_index_t; typedef uint32_t xkb_mod_index_t;
@ -97,8 +99,6 @@ typedef uint32_t xkb_led_index_t;
#define XKB_KEYCODE_INVALID (0xffffffff) #define XKB_KEYCODE_INVALID (0xffffffff)
#define XKB_LED_INVALID (0xffffffff) #define XKB_LED_INVALID (0xffffffff)
#define XKB_KEYSYM_NO_SYMBOL 0
#define XKB_KEYCODE_MAX (0xffffffff - 1) #define XKB_KEYCODE_MAX (0xffffffff - 1)
#define xkb_keycode_is_legal_ext(kc) (kc <= XKB_KEYCODE_MAX) #define xkb_keycode_is_legal_ext(kc) (kc <= XKB_KEYCODE_MAX)
#define xkb_keycode_is_legal_x11(kc) (kc <= XKB_KEYCODE_MAX) #define xkb_keycode_is_legal_x11(kc) (kc <= XKB_KEYCODE_MAX)

View File

@ -32,8 +32,8 @@ from The Open Group.
*/ */
#include "xkbcommon/xkbcommon.h" #include "xkbcommon/xkbcommon.h"
#include "xkbcommon/xkbcommon-keysyms.h"
#include <X11/keysymdef.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -62,40 +62,19 @@ parse_line(const char *buf, char *key, xkb_keysym_t *val, char *prefix)
{ {
int i; int i;
char alias[128]; char alias[128];
char *tmp, *tmpa;
/* See if we can catch a straight XK_foo 0x1234-style definition first; /* See if we can catch a straight XK_foo 0x1234-style definition first;
* the trickery around tmp is to account for prefices. */ * the trickery around tmp is to account for prefices. */
i = sscanf(buf, "#define %127s 0x%"SCNx32, key, val); i = sscanf(buf, "#define %127s 0x%"SCNx32, key, val);
if (i == 2 && (tmp = strstr(key, "XK_"))) { if (i == 2 && strncmp(key, "XKB_KEY_", 8) == 0) {
memcpy(prefix, key, tmp - key); prefix[0] = '\0';
prefix[tmp - key] = '\0'; memmove(key, key + 8, strlen(key + 8) + 1);
tmp += 3;
memmove(key, tmp, strlen(tmp) + 1);
return 1; return 1;
} }
/* Now try to catch alias (XK_foo XK_bar) definitions, and resolve them
* immediately: if the target is in the form XF86XK_foo, we need to
* canonicalise this to XF86foo before we do the lookup. */
i = sscanf(buf, "#define %127s %127s", key, alias); i = sscanf(buf, "#define %127s %127s", key, alias);
if (i == 2 && (tmp = strstr(key, "XK_")) && (tmpa = strstr(alias, "XK_"))) { if (i == 2)
memcpy(prefix, key, tmp - key); fprintf(stderr, "can't parse keysym definition: %s", buf);
prefix[tmp - key] = '\0';
tmp += 3;
memmove(key, tmp, strlen(tmp) + 1);
memmove(tmpa, tmpa + 3, strlen(tmpa + 3) + 1);
for (i = ksnum - 1; i >= 0; i--) {
if (strcmp(info[i].name, alias) == 0) {
*val = info[i].val;
return 1;
}
}
fprintf(stderr, "can't find matching definition %s for keysym %s%s\n",
alias, prefix, key);
}
return 0; return 0;
} }
@ -128,7 +107,7 @@ main(int argc, char *argv[])
if (!parse_line(buf, key, &val, prefix)) if (!parse_line(buf, key, &val, prefix))
continue; continue;
if (val == XK_VoidSymbol) if (val == XKB_KEY_VoidSymbol)
val = 0; val = 0;
if (val > 0x1fffffff) { if (val > 0x1fffffff) {
fprintf(stderr, "ignoring illegal keysym (%s, %"PRIx32")\n", key, fprintf(stderr, "ignoring illegal keysym (%s, %"PRIx32")\n", key,
@ -154,9 +133,9 @@ main(int argc, char *argv[])
fclose(fptr); fclose(fptr);
} }
/* Special case XKB_KEYSYM_NO_SYMBOL. */ /* Special case XKB_KEY_NoSymbol. */
info[ksnum].name = strdup("NoSymbol"); info[ksnum].name = strdup("NoSymbol");
info[ksnum].val = XKB_KEYSYM_NO_SYMBOL; info[ksnum].val = XKB_KEY_NoSymbol;
ksnum++; ksnum++;
printf("/* This file is generated from keysymdef.h. */\n"); printf("/* This file is generated from keysymdef.h. */\n");

View File

@ -28,7 +28,6 @@ authorization from the authors.
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <X11/keysymdef.h>
#include "ks_tables.h" #include "ks_tables.h"
#include "xkbmisc.h" #include "xkbmisc.h"
@ -47,7 +46,7 @@ xkb_keysym_to_string(xkb_keysym_t ks, char *buffer, size_t size)
} }
/* Not listed in keysymdef.h for hysterical raisins. */ /* Not listed in keysymdef.h for hysterical raisins. */
if (ks == XKB_KEYSYM_NO_SYMBOL) { if (ks == XKB_KEY_NoSymbol) {
snprintf(buffer, size, "NoSymbol"); snprintf(buffer, size, "NoSymbol");
return; return;
} }
@ -117,7 +116,7 @@ xkb_string_to_keysym(const char *s)
val = (entry[2] << 24) | (entry[3] << 16) | val = (entry[2] << 24) | (entry[3] << 16) |
(entry[4] << 8) | entry[5]; (entry[4] << 8) | entry[5];
if (!val) if (!val)
val = XK_VoidSymbol; val = XKB_KEY_VoidSymbol;
return val; return val;
} }
@ -132,20 +131,20 @@ xkb_string_to_keysym(const char *s)
if (*s == 'U') { if (*s == 'U') {
val = strtoul(&s[1], &tmp, 16); val = strtoul(&s[1], &tmp, 16);
if (tmp && *tmp != '\0') if (tmp && *tmp != '\0')
return XKB_KEYSYM_NO_SYMBOL; return XKB_KEY_NoSymbol;
if (val < 0x20 || (val > 0x7e && val < 0xa0)) if (val < 0x20 || (val > 0x7e && val < 0xa0))
return XKB_KEYSYM_NO_SYMBOL; return XKB_KEY_NoSymbol;
if (val < 0x100) if (val < 0x100)
return val; return val;
if (val > 0x10ffff) if (val > 0x10ffff)
return XKB_KEYSYM_NO_SYMBOL; return XKB_KEY_NoSymbol;
return val | 0x01000000; return val | 0x01000000;
} }
else if (s[0] == '0' && s[1] == 'x') { else if (s[0] == '0' && s[1] == 'x') {
val = strtoul(&s[2], &tmp, 16); val = strtoul(&s[2], &tmp, 16);
if (tmp && *tmp != '\0') if (tmp && *tmp != '\0')
return XKB_KEYSYM_NO_SYMBOL; return XKB_KEY_NoSymbol;
return val; return val;
} }
@ -157,12 +156,12 @@ xkb_string_to_keysym(const char *s)
xkb_keysym_t ret; xkb_keysym_t ret;
tmp = strdup(s); tmp = strdup(s);
if (!tmp) if (!tmp)
return XKB_KEYSYM_NO_SYMBOL; return XKB_KEY_NoSymbol;
memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1); memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1);
ret = xkb_string_to_keysym(tmp); ret = xkb_string_to_keysym(tmp);
free(tmp); free(tmp);
return ret; return ret;
} }
return XKB_KEYSYM_NO_SYMBOL; return XKB_KEY_NoSymbol;
} }

View File

@ -28,7 +28,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "xkbmisc.h" #include "xkbmisc.h"
#include "xkbcommon/xkbcommon.h" #include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h" #include "XKBcommonint.h"
#include <X11/keysym.h>
#define mapSize(m) (sizeof(m) / sizeof(struct xkb_kt_map_entry)) #define mapSize(m) (sizeof(m) / sizeof(struct xkb_kt_map_entry))
static struct xkb_kt_map_entry map2Level[]= { static struct xkb_kt_map_entry map2Level[]= {
@ -192,69 +191,69 @@ _XkbcKSCheckCase(xkb_keysym_t ks)
switch (set) { switch (set) {
case 0: /* latin 1 */ case 0: /* latin 1 */
if ((ks >= XK_A && ks <= XK_Z) || if ((ks >= XKB_KEY_A && ks <= XKB_KEY_Z) ||
(ks >= XK_Agrave && ks <= XK_THORN && ks != XK_multiply)) (ks >= XKB_KEY_Agrave && ks <= XKB_KEY_THORN && ks != XKB_KEY_multiply))
rtrn |= _XkbKSUpper; rtrn |= _XkbKSUpper;
if ((ks >= XK_a && ks <= XK_z) || if ((ks >= XKB_KEY_a && ks <= XKB_KEY_z) ||
(ks >= XK_agrave && ks <= XK_ydiaeresis)) (ks >= XKB_KEY_agrave && ks <= XKB_KEY_ydiaeresis))
rtrn |= _XkbKSLower; rtrn |= _XkbKSLower;
break; break;
case 1: /* latin 2 */ case 1: /* latin 2 */
if ((ks >= XK_Aogonek && ks <= XK_Zabovedot && ks != XK_breve) || if ((ks >= XKB_KEY_Aogonek && ks <= XKB_KEY_Zabovedot && ks != XKB_KEY_breve) ||
(ks >= XK_Racute && ks<=XK_Tcedilla)) (ks >= XKB_KEY_Racute && ks<=XKB_KEY_Tcedilla))
rtrn |= _XkbKSUpper; rtrn |= _XkbKSUpper;
if ((ks >= XK_aogonek && ks <= XK_zabovedot && ks != XK_caron) || if ((ks >= XKB_KEY_aogonek && ks <= XKB_KEY_zabovedot && ks != XKB_KEY_caron) ||
(ks >= XK_racute && ks <= XK_tcedilla)) (ks >= XKB_KEY_racute && ks <= XKB_KEY_tcedilla))
rtrn |= _XkbKSLower; rtrn |= _XkbKSLower;
break; break;
case 2: /* latin 3 */ case 2: /* latin 3 */
if ((ks >= XK_Hstroke && ks <= XK_Jcircumflex) || if ((ks >= XKB_KEY_Hstroke && ks <= XKB_KEY_Jcircumflex) ||
(ks >= XK_Cabovedot && ks <= XK_Scircumflex)) (ks >= XKB_KEY_Cabovedot && ks <= XKB_KEY_Scircumflex))
rtrn |= _XkbKSUpper; rtrn |= _XkbKSUpper;
if ((ks >= XK_hstroke && ks <= XK_jcircumflex) || if ((ks >= XKB_KEY_hstroke && ks <= XKB_KEY_jcircumflex) ||
(ks >= XK_cabovedot && ks <= XK_scircumflex)) (ks >= XKB_KEY_cabovedot && ks <= XKB_KEY_scircumflex))
rtrn |= _XkbKSLower; rtrn |= _XkbKSLower;
break; break;
case 3: /* latin 4 */ case 3: /* latin 4 */
if ((ks >= XK_Rcedilla && ks <= XK_Tslash) || if ((ks >= XKB_KEY_Rcedilla && ks <= XKB_KEY_Tslash) ||
(ks == XK_ENG) || (ks == XKB_KEY_ENG) ||
(ks >= XK_Amacron && ks <= XK_Umacron)) (ks >= XKB_KEY_Amacron && ks <= XKB_KEY_Umacron))
rtrn |= _XkbKSUpper; rtrn |= _XkbKSUpper;
if ((ks >= XK_rcedilla && ks <= XK_tslash) || if ((ks >= XKB_KEY_rcedilla && ks <= XKB_KEY_tslash) ||
(ks == XK_eng) || (ks == XKB_KEY_eng) ||
(ks >= XK_amacron && ks <= XK_umacron)) (ks >= XKB_KEY_amacron && ks <= XKB_KEY_umacron))
rtrn |= _XkbKSLower; rtrn |= _XkbKSLower;
break; break;
case 18: /* latin 8 */ case 18: /* latin 8 */
if ((ks == XK_Wcircumflex) || if ((ks == XKB_KEY_Wcircumflex) ||
(ks == XK_Ycircumflex) || (ks == XKB_KEY_Ycircumflex) ||
(ks == XK_Babovedot) || (ks == XKB_KEY_Babovedot) ||
(ks == XK_Dabovedot) || (ks == XKB_KEY_Dabovedot) ||
(ks == XK_Fabovedot) || (ks == XKB_KEY_Fabovedot) ||
(ks == XK_Mabovedot) || (ks == XKB_KEY_Mabovedot) ||
(ks == XK_Pabovedot) || (ks == XKB_KEY_Pabovedot) ||
(ks == XK_Sabovedot) || (ks == XKB_KEY_Sabovedot) ||
(ks == XK_Tabovedot) || (ks == XKB_KEY_Tabovedot) ||
(ks == XK_Wdiaeresis) || (ks == XKB_KEY_Wdiaeresis) ||
(ks == XK_Ygrave)) (ks == XKB_KEY_Ygrave))
rtrn |= _XkbKSUpper; rtrn |= _XkbKSUpper;
if ((ks == XK_wcircumflex) || if ((ks == XKB_KEY_wcircumflex) ||
(ks == XK_ycircumflex) || (ks == XKB_KEY_ycircumflex) ||
(ks == XK_babovedot) || (ks == XKB_KEY_babovedot) ||
(ks == XK_dabovedot) || (ks == XKB_KEY_dabovedot) ||
(ks == XK_fabovedot) || (ks == XKB_KEY_fabovedot) ||
(ks == XK_mabovedot) || (ks == XKB_KEY_mabovedot) ||
(ks == XK_pabovedot) || (ks == XKB_KEY_pabovedot) ||
(ks == XK_sabovedot) || (ks == XKB_KEY_sabovedot) ||
(ks == XK_tabovedot) || (ks == XKB_KEY_tabovedot) ||
(ks == XK_wdiaeresis) || (ks == XKB_KEY_wdiaeresis) ||
(ks == XK_ygrave)) (ks == XKB_KEY_ygrave))
rtrn |= _XkbKSLower; rtrn |= _XkbKSLower;
break; break;
case 19: /* latin 9 */ case 19: /* latin 9 */
if (ks == XK_OE || ks == XK_Ydiaeresis) if (ks == XKB_KEY_OE || ks == XKB_KEY_Ydiaeresis)
rtrn |= _XkbKSUpper; rtrn |= _XkbKSUpper;
if (ks == XK_oe) if (ks == XKB_KEY_oe)
rtrn |= _XkbKSLower; rtrn |= _XkbKSLower;
break; break;
} }

View File

@ -777,8 +777,8 @@ CopyInterps(CompatInfo * info,
for (si = info->interps; si; si = (SymInterpInfo *) si->defs.next) for (si = info->interps; si; si = (SymInterpInfo *) si->defs.next)
{ {
if (((si->interp.match & XkbSI_OpMask) != pred) || if (((si->interp.match & XkbSI_OpMask) != pred) ||
(needSymbol && (si->interp.sym == XKB_KEYSYM_NO_SYMBOL)) || (needSymbol && (si->interp.sym == XKB_KEY_NoSymbol)) ||
((!needSymbol) && (si->interp.sym != XKB_KEYSYM_NO_SYMBOL))) ((!needSymbol) && (si->interp.sym != XKB_KEY_NoSymbol)))
continue; continue;
if (compat->num_si >= compat->size_si) if (compat->num_si >= compat->size_si)
{ {
@ -892,7 +892,7 @@ UpdateActionMods(struct xkb_keymap *xkb, union xkb_action *act, uint32_t rmodmas
/** /**
* Find an interpretation which applies to this particular level, either by * Find an interpretation which applies to this particular level, either by
* finding an exact match for the symbol and modifier combination, or a * finding an exact match for the symbol and modifier combination, or a
* generic XKB_KEYSYM_NO_SYMBOL match. * generic XKB_KEY_NoSymbol match.
*/ */
static struct xkb_sym_interpret * static struct xkb_sym_interpret *
FindInterpForKey(struct xkb_keymap *xkb, xkb_keycode_t key, uint32_t group, uint32_t level) FindInterpForKey(struct xkb_keymap *xkb, xkb_keycode_t key, uint32_t group, uint32_t level)
@ -912,7 +912,7 @@ FindInterpForKey(struct xkb_keymap *xkb, xkb_keycode_t key, uint32_t group, uint
bool found; bool found;
if ((num_syms > 1 || interp->sym != syms[0]) && if ((num_syms > 1 || interp->sym != syms[0]) &&
interp->sym != XKB_KEYSYM_NO_SYMBOL) interp->sym != XKB_KEY_NoSymbol)
continue; continue;
if (level == 0 || !(interp->match & XkbSI_LevelOneOnly)) if (level == 0 || !(interp->match & XkbSI_LevelOneOnly))
@ -941,7 +941,7 @@ FindInterpForKey(struct xkb_keymap *xkb, xkb_keycode_t key, uint32_t group, uint
break; break;
} }
if (found && interp->sym != XKB_KEYSYM_NO_SYMBOL) if (found && interp->sym != XKB_KEY_NoSymbol)
return interp; return interp;
else if (found && !ret) else if (found && !ret)
ret = interp; ret = interp;

View File

@ -985,7 +985,7 @@ ExprResolveKeySym(ExprDef * expr,
str = XkbcAtomText(expr->value.str); str = XkbcAtomText(expr->value.str);
if (str) { if (str) {
sym = xkb_string_to_keysym(str); sym = xkb_string_to_keysym(str);
if (sym != XKB_KEYSYM_NO_SYMBOL) { if (sym != XKB_KEY_NoSymbol) {
val_rtrn->uval = sym; val_rtrn->uval = sym;
return true; return true;
} }

View File

@ -29,8 +29,6 @@
#include "xkbpath.h" #include "xkbpath.h"
#include "xkbparse.h" #include "xkbparse.h"
#include <X11/keysym.h>
ParseCommon * ParseCommon *
AppendStmt(ParseCommon * to, ParseCommon * append) AppendStmt(ParseCommon * to, ParseCommon * append)
{ {
@ -540,17 +538,17 @@ LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn)
if ((!str) || (strcasecmp(str, "any") == 0) || if ((!str) || (strcasecmp(str, "any") == 0) ||
(strcasecmp(str, "nosymbol") == 0)) (strcasecmp(str, "nosymbol") == 0))
{ {
*sym_rtrn = XKB_KEYSYM_NO_SYMBOL; *sym_rtrn = XKB_KEY_NoSymbol;
return 1; return 1;
} }
else if ((strcasecmp(str, "none") == 0) || else if ((strcasecmp(str, "none") == 0) ||
(strcasecmp(str, "voidsymbol") == 0)) (strcasecmp(str, "voidsymbol") == 0))
{ {
*sym_rtrn = XK_VoidSymbol; *sym_rtrn = XKB_KEY_VoidSymbol;
return 1; return 1;
} }
sym = xkb_string_to_keysym(str); sym = xkb_string_to_keysym(str);
if (sym != XKB_KEYSYM_NO_SYMBOL) if (sym != XKB_KEY_NoSymbol)
{ {
*sym_rtrn = sym; *sym_rtrn = sym;
return 1; return 1;

View File

@ -30,7 +30,6 @@
#include "expr.h" #include "expr.h"
#include "parseutils.h" #include "parseutils.h"
#include <X11/keysym.h>
#include <stdlib.h> #include <stdlib.h>
#include "expr.h" #include "expr.h"
@ -1079,7 +1078,7 @@ AddSymbolsToKey(KeyInfo * key,
value->value.list.syms[i], longText(key->name), ndx + 1, value->value.list.syms[i], longText(key->name), ndx + 1,
XkbcAtomText(info->groupNames[ndx]), nSyms); XkbcAtomText(info->groupNames[ndx]), nSyms);
while (--j >= 0) while (--j >= 0)
key->syms[ndx][key->symsMapIndex[ndx][i] + j] = NoSymbol; key->syms[ndx][key->symsMapIndex[ndx][i] + j] = XKB_KEY_NoSymbol;
key->symsMapIndex[ndx][i] = -1; key->symsMapIndex[ndx][i] = -1;
key->symsMapNumEntries[ndx][i] = 0; key->symsMapNumEntries[ndx][i] = 0;
break; break;

View File

@ -31,7 +31,6 @@
#include "parseutils.h" #include "parseutils.h"
#include "xkbmisc.h" #include "xkbmisc.h"
#include <X11/keysym.h>
#include <stdlib.h> #include <stdlib.h>
extern int yylex(union YYSTYPE *val, struct YYLTYPE *loc, void *scanner); extern int yylex(union YYSTYPE *val, struct YYLTYPE *loc, void *scanner);

View File

@ -64,7 +64,7 @@ _XkbcKSCheckCase(xkb_keysym_t sym);
#define XkbcKSIsLower(k) (_XkbcKSCheckCase(k) & _XkbKSLower) #define XkbcKSIsLower(k) (_XkbcKSCheckCase(k) & _XkbKSLower)
#define XkbcKSIsUpper(k) (_XkbcKSCheckCase(k) & _XkbKSUpper) #define XkbcKSIsUpper(k) (_XkbcKSCheckCase(k) & _XkbKSUpper)
#define XkbKSIsKeypad(k) (((k) >= XK_KP_Space) && ((k) <= XK_KP_Equal)) #define XkbKSIsKeypad(k) (((k) >= XKB_KEY_KP_Space) && ((k) <= XKB_KEY_KP_Equal))
/***====================================================================***/ /***====================================================================***/

View File

@ -26,7 +26,6 @@
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <X11/keysym.h>
#include <linux/input.h> #include <linux/input.h>
#include "xkbcommon/xkbcommon.h" #include "xkbcommon/xkbcommon.h"
@ -135,7 +134,7 @@ test_update_key(struct xkb_keymap *xkb)
XKB_STATE_LOCKED)); XKB_STATE_LOCKED));
assert(xkb_state_led_name_is_active(state, "Caps Lock")); assert(xkb_state_led_name_is_active(state, "Caps Lock"));
num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms); num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms);
assert(num_syms == 1 && syms[0] == XK_Q); assert(num_syms == 1 && syms[0] == XKB_KEY_Q);
/* Caps unlocked */ /* Caps unlocked */
xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN); xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN);
@ -144,7 +143,7 @@ test_update_key(struct xkb_keymap *xkb)
XKB_STATE_EFFECTIVE)); XKB_STATE_EFFECTIVE));
assert(!xkb_state_led_name_is_active(state, "Caps Lock")); assert(!xkb_state_led_name_is_active(state, "Caps Lock"));
num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms); num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms);
assert(num_syms == 1 && syms[0] == XK_q); assert(num_syms == 1 && syms[0] == XKB_KEY_q);
xkb_state_unref(state); xkb_state_unref(state);
} }

View File

@ -35,7 +35,7 @@ int
main(void) main(void)
{ {
assert(test_string("Undo", 0xFF65)); assert(test_string("Undo", 0xFF65));
assert(test_string("ThisKeyShouldNotExist", XKB_KEYSYM_NO_SYMBOL)); assert(test_string("ThisKeyShouldNotExist", XKB_KEY_NoSymbol));
assert(test_string("XF86_Switch_VT_5", 0x1008FE05)); assert(test_string("XF86_Switch_VT_5", 0x1008FE05));
assert(test_string("VoidSymbol", 0xFFFFFF)); assert(test_string("VoidSymbol", 0xFFFFFF));
assert(test_string("U4567", 0x1004567)); assert(test_string("U4567", 0x1004567));