restore the old behavior of wmiimenu; Shift-Enter can be used to print the entered text instead of the selected item now.

This commit is contained in:
Sander van Dijk 2006-04-19 23:02:31 +00:00
parent 43ee717835
commit 74a288bccd
2 changed files with 7 additions and 2 deletions

View File

@ -37,7 +37,10 @@ Tab (Control-i)
copy the selected item to the input field.
.TP 2
Enter (Control-j)
confirm selection and quit.
confirm selection and quit (print the selected item to stdout).
.TP 2
Shift-Enter (Shift-Control-j)
confirm selection and quit (print the text in the input field to stdout).
.TP 2
Escape (Control-[)
quit without selecting an item.

View File

@ -239,10 +239,12 @@ handle_kpress(XKeyEvent * e)
sel++;
break;
case XK_Return:
if(text)
if(e->state & ShiftMask)
fprintf(stdout, "%s", text);
else if(sel >= 0)
fprintf(stdout, "%s", item.data[sel]);
else if(text)
fprintf(stdout, "%s", text);
fflush(stdout);
done = True;
break;