fix shift key
This commit is contained in:
parent
10d457c97e
commit
0129fde447
17
xmenu.c
17
xmenu.c
|
@ -1320,11 +1320,11 @@ enteritem:
|
||||||
switch (ksym) {
|
switch (ksym) {
|
||||||
case XK_Home:
|
case XK_Home:
|
||||||
item = itemcycle(currmenu, ITEMFIRST);
|
item = itemcycle(currmenu, ITEMFIRST);
|
||||||
action = ACTION_CLEAR;
|
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
|
||||||
break;
|
break;
|
||||||
case XK_End:
|
case XK_End:
|
||||||
item = itemcycle(currmenu, ITEMLAST);
|
item = itemcycle(currmenu, ITEMLAST);
|
||||||
action = ACTION_CLEAR;
|
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
|
||||||
break;
|
break;
|
||||||
case XK_ISO_Left_Tab:
|
case XK_ISO_Left_Tab:
|
||||||
if (*text) {
|
if (*text) {
|
||||||
|
@ -1334,7 +1334,7 @@ enteritem:
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case XK_Up:
|
case XK_Up:
|
||||||
item = itemcycle(currmenu, ITEMPREV);
|
item = itemcycle(currmenu, ITEMPREV);
|
||||||
action = ACTION_CLEAR;
|
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
|
||||||
break;
|
break;
|
||||||
case XK_Tab:
|
case XK_Tab:
|
||||||
if (*text) {
|
if (*text) {
|
||||||
|
@ -1344,7 +1344,7 @@ enteritem:
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case XK_Down:
|
case XK_Down:
|
||||||
item = itemcycle(currmenu, ITEMNEXT);
|
item = itemcycle(currmenu, ITEMNEXT);
|
||||||
action = ACTION_CLEAR;
|
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:
|
||||||
item = itemcycle(currmenu, ITEMFIRST);
|
item = itemcycle(currmenu, ITEMFIRST);
|
||||||
|
@ -1353,13 +1353,14 @@ enteritem:
|
||||||
currmenu->selected = item;
|
currmenu->selected = item;
|
||||||
item = itemcycle(currmenu, ITEMNEXT);
|
item = itemcycle(currmenu, ITEMNEXT);
|
||||||
}
|
}
|
||||||
action = ACTION_CLEAR;
|
action = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
|
||||||
break;
|
break;
|
||||||
case XK_Return: case XK_Right:
|
case XK_Return: case XK_Right:
|
||||||
if (currmenu->selected) {
|
if (currmenu->selected) {
|
||||||
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) {
|
||||||
|
@ -1367,12 +1368,15 @@ enteritem:
|
||||||
currmenu = currmenu->parent;
|
currmenu = currmenu->parent;
|
||||||
action = ACTION_CLEAR | ACTION_MAP;
|
action = ACTION_CLEAR | ACTION_MAP;
|
||||||
}
|
}
|
||||||
|
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 = ACTION_CLEAR | ACTION_SELECT | ACTION_DRAW;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
append:
|
append:
|
||||||
|
if (*buf == '\0' || iscntrl(*buf))
|
||||||
|
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 ((item = matchitem(currmenu, text, 0)))
|
||||||
|
@ -1382,7 +1386,6 @@ append:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
select = item;
|
select = item;
|
||||||
action |= ACTION_SELECT | ACTION_DRAW;
|
|
||||||
break;
|
break;
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
previtem = NULL;
|
previtem = NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user