diff --git a/config.h b/config.h index 9886a72..6eb9b7c 100644 --- a/config.h +++ b/config.h @@ -34,9 +34,6 @@ static struct Config config = { /* area around the icon, the triangle and the separator */ .horzpadding = 8, - - /* if nonzero, enable type-to-select feature, can be togglet with -t */ - .typetoselect = 0 }; /* diff --git a/xmenu.1 b/xmenu.1 index 3f45a0b..82a6ebb 100644 --- a/xmenu.1 +++ b/xmenu.1 @@ -3,7 +3,7 @@ xmenu \- menu utility for X .SH SYNOPSIS .B xmenu -.RB [ \-irtw ] +.RB [ \-irw ] .RB [ -p .IR position ] .RI [ title ] @@ -58,10 +58,6 @@ must spawn at the position 100x500 of the monitor 0. If this option is set, the right mouse button is disabled; so pressing it will not trigger any menu item. .TP -.B -t -If this option is set, the type-to-select feature is enabled, -so typing a string will select the first item matching it. -.TP .B -w Asks the window manager to draw a border around the menus. This option may be buggy in some window managers, @@ -105,6 +101,7 @@ Items can be selected using the arrow keys, Tab (with and without Shift), Home, End, Enter and Esc, and 1-9 keys. +Items can also be selected by typing the first several characters in it. .TP .BR Home Select the first item in the menu. @@ -117,16 +114,14 @@ Cycle through the items in the regular direction. .TP .BR Tab Cycle through the items in the regular direction. -If the type-to-select feature is enabled, and there is a typed string in memory, -cycle through matching items instead. +When the type\-to\-select feature is active, cycle through matching items instead. .TP .BR Up Cycle through the items in the reverse direction. .TP .BR Shift-Tab Cycle through the items in the reverse direction. -If the type-to-select feature is enabled, and there is a typed string in memory, -cycle through matching items instead. +When the type\-to\-select feature is active, cycle through matching items instead. .TP .BR Right ", " Enter Select the highlighted item. @@ -137,6 +132,10 @@ Go to the menu above. .B Esc Go to the menu above or exit xmenu. .PP +.B xmenu +features the type\-to\-select selecting style, +where typing a string will select the first item matching it. +.PP Additional key bindings can be set at compile time by changing the .B config.h file. diff --git a/xmenu.c b/xmenu.c index acdabc2..f2eaab4 100644 --- a/xmenu.c +++ b/xmenu.c @@ -141,7 +141,7 @@ getoptions(int argc, char *argv[]) { int ch; - while ((ch = getopt(argc, argv, "ip:rtw")) != -1) { + while ((ch = getopt(argc, argv, "ip:rw")) != -1) { switch (ch) { case 'i': iflag = 1; @@ -153,9 +153,6 @@ getoptions(int argc, char *argv[]) case 'r': rflag = 1; break; - case 't': - config.typetoselect = !config.typetoselect; - break; case 'w': wflag = 1; break; @@ -1376,8 +1373,6 @@ enteritem: break; default: append: - if (!config.typetoselect) - break; for (i = 0; i < 2; i++) { append(text, buf, sizeof text, len); if ((item = matchitem(currmenu, text, 0))) @@ -1490,7 +1485,7 @@ main(int argc, char *argv[]) if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) errx(1, "XOpenIM: could not open input device"); - /* get configuration */ + /* process configuration and window class */ getresources(); classh.res_class = PROGNAME; classh.res_name = getoptions(argc, argv); diff --git a/xmenu.h b/xmenu.h index 385eb82..b5f1556 100644 --- a/xmenu.h +++ b/xmenu.h @@ -50,7 +50,6 @@ struct Config { int iconpadding; int horzpadding; int alignment; - int typetoselect; /* the values below are set by options */ int monitor;