wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 74a288bccdefaa242307d3e3bba1d6fa72956e03
parent 43ee717835667aed41f4dc7a570866527dfdadec
Author: Sander van Dijk <sander@wmii.de>
Date:   Wed, 19 Apr 2006 23:02:31 +0000

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


Diffstat:
cmd/wmiimenu.1 | 5++++-
cmd/wmiimenu.c | 4+++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cmd/wmiimenu.1 b/cmd/wmiimenu.1 @@ -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. diff --git a/cmd/wmiimenu.c b/cmd/wmiimenu.c @@ -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;