errx(1, "improper position: %s", optarg);
}
-/* parse color string */
+/* parse font string */
static void
parsefonts(const char *s)
{
struct Menu *menu;
struct Item *item;
struct Item *previtem = NULL;
+ struct Item *lastitem;
KeySym ksym;
XEvent ev;
item = itemcycle(currmenu, ITEMPREV);
} else if (ksym == XK_Tab || ksym == XK_Down || ksym == KSYMDOWN) {
item = itemcycle(currmenu, ITEMNEXT);
+ } else if (ksym >= XK_1 && ksym <= XK_9){
+ item = itemcycle(currmenu, ITEMFIRST);
+ lastitem = itemcycle(currmenu, ITEMLAST);
+ for (int i = ksym - XK_1; i > 0 && item != lastitem; i--) {
+ currmenu->selected = item;
+ item = itemcycle(currmenu, ITEMNEXT);
+ }
} else if ((ksym == XK_Return || ksym == XK_Right || ksym == KSYMRIGHT) &&
- currmenu->selected != NULL) {
+ currmenu->selected != NULL) {
item = currmenu->selected;
goto selectitem;
} else if ((ksym == XK_Escape || ksym == XK_Left || ksym == KSYMLEFT) &&