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
4.5.4 (2021-01-09)
• Fixed ESC key.
4.5.3 (2021-01-09)
• Fixed missing lines in xmenu.c.

24
xmenu.c
View File

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