/* 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
};
/*
xmenu \- menu utility for X
.SH SYNOPSIS
.B xmenu
-.RB [ \-irw ]
+.RB [ \-irtw ]
.RB [ -p
.IR position ]
.RI [ title ]
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,
.BR End
Select the last item in the menu.
.TP
-.BR Down ", " Tab
+.BR Down
+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.
+.TP
+.BR Up
+Cycle through the items in the reverse direction.
.TP
-.BR Up ", " Shift-Tab
+.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.
.TP
.BR Right ", " Enter
Select the highlighted item.
{
int ch;
- while ((ch = getopt(argc, argv, "ip:rw")) != -1) {
+ while ((ch = getopt(argc, argv, "ip:rtw")) != -1) {
switch (ch) {
case 'i':
iflag = 1;
case 'r':
rflag = 1;
break;
+ case 't':
+ config.typetoselect = !config.typetoselect;
+ break;
case 'w':
wflag = 1;
break;
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)))