fixed ESC key

This commit is contained in:
phillbush 2021-01-09 19:41:16 -03:00
parent e14d88b06c
commit 06d6acdb5e
2 changed files with 14 additions and 13 deletions

View File

@ -1,5 +1,8 @@
CHANGELOG CHANGELOG
4.5.4 (2021-01-09)
• Fixed ESC key.
4.5.3 (2021-01-09) 4.5.3 (2021-01-09)
• Fixed missing lines in xmenu.c. • Fixed missing lines in xmenu.c.

24
xmenu.c
View File

@ -1315,37 +1315,37 @@ enteritem:
ksym = XK_ISO_Left_Tab; ksym = XK_ISO_Left_Tab;
/* cycle through menu */ /* cycle through menu */
item = NULL; select = NULL;
ksym = normalizeksym(ksym); ksym = normalizeksym(ksym);
switch (ksym) { switch (ksym) {
case XK_Home: case XK_Home:
item = itemcycle(currmenu, ITEMFIRST); select = itemcycle(currmenu, ITEMFIRST);
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_End: case XK_End:
item = itemcycle(currmenu, ITEMLAST); select = itemcycle(currmenu, ITEMLAST);
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_ISO_Left_Tab: case XK_ISO_Left_Tab:
if (*text) { if (*text) {
item = matchitem(currmenu, text, -1); select = matchitem(currmenu, text, -1);
action = ACTION_SELECT | ACTION_DRAW; action = ACTION_SELECT | ACTION_DRAW;
break; break;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
case XK_Up: case XK_Up:
item = itemcycle(currmenu, ITEMPREV); select = itemcycle(currmenu, ITEMPREV);
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_Tab: case XK_Tab:
if (*text) { if (*text) {
item = matchitem(currmenu, text, 1); select = matchitem(currmenu, text, 1);
action = ACTION_SELECT | ACTION_DRAW; action = ACTION_SELECT | ACTION_DRAW;
break; break;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
case XK_Down: case XK_Down:
item = itemcycle(currmenu, ITEMNEXT); select = itemcycle(currmenu, ITEMNEXT);
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_1: case XK_2: case XK_3: case XK_4: case XK_5: case XK_6: case XK_7: case XK_8: case XK_9: case XK_1: case XK_2: case XK_3: case XK_4: case XK_5: case XK_6: case XK_7: case XK_8: case XK_9:
@ -1355,6 +1355,7 @@ enteritem:
currmenu->selected = item; currmenu->selected = item;
item = itemcycle(currmenu, ITEMNEXT); item = itemcycle(currmenu, ITEMNEXT);
} }
select = item;
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_Return: case XK_Right: case XK_Return: case XK_Right:
@ -1362,15 +1363,13 @@ enteritem:
item = currmenu->selected; item = currmenu->selected;
goto enteritem; goto enteritem;
} }
action = ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_Escape: case XK_Left: case XK_Escape: case XK_Left:
if (currmenu->parent) { if (currmenu->parent) {
item = currmenu->parent->selected; select = currmenu->parent->selected;
currmenu = currmenu->parent; currmenu = currmenu->parent;
action = ACTION_CLEAR | ACTION_MAP; action = ACTION_CLEAR | ACTION_MAP | ACTION_SELECT | ACTION_DRAW;
} }
action = ACTION_SELECT | ACTION_DRAW;
break; break;
case XK_BackSpace: case XK_Clear: case XK_Delete: case XK_BackSpace: case XK_Clear: case XK_Delete:
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW; action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
@ -1381,14 +1380,13 @@ append:
break; break;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
append(text, buf, sizeof text, len); append(text, buf, sizeof text, len);
if ((item = matchitem(currmenu, text, 0))) if ((select = matchitem(currmenu, text, 0)))
break; break;
text[0] = '\0'; text[0] = '\0';
} }
action = ACTION_SELECT | ACTION_DRAW; action = ACTION_SELECT | ACTION_DRAW;
break; break;
} }
select = item;
break; break;
case LeaveNotify: case LeaveNotify:
previtem = NULL; previtem = NULL;