From 13a7c4a7335a6695ede3f2f3a58a06479ea9a6a2 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 10 Mar 2017 23:30:02 +0100 Subject: Keystroke.c: use symbols instead of integers We have defined them, so use them! --- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index e61ecd2a5..281fec243 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -168,7 +168,7 @@ static Bool modifier_matches(unsigned int mask, int compare_alt_meta, unsigned i static Bool read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystrokeMap *ret) { struct nxagentSpecialKeystrokeMap newkm = { - .stroke = 0, + .stroke = KEYSTROKE_END_MARKER, .modifierMask = 0, .modifierAltMeta = False, .keysym = NoSymbol @@ -186,8 +186,10 @@ static Bool read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystr #endif continue; } + if (strcmp((char *)attr->name, "action") == 0) { + newkm.stroke = KEYSTROKE_END_MARKER; for (int i = 0; nxagentSpecialKeystrokeNames[i] != NULL; i++) { if (strcmp(nxagentSpecialKeystrokeNames[i],(char *)attr->children->content) == 0) @@ -222,7 +224,7 @@ static Bool read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystr else if (strcmp((char *)attr->name, "AltMeta") == 0) { newkm.modifierAltMeta = True; } } - if (newkm.stroke != 0 && newkm.keysym != NoSymbol) + if (newkm.stroke != KEYSTROKE_END_MARKER && newkm.keysym != NoSymbol) { /* keysym and stroke are required, everything else is optional */ memcpy(ret, &newkm, sizeof(struct nxagentSpecialKeystrokeMap)); -- cgit v1.2.3