summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2014-05-18 12:11:02 +0200
committerQC <qball@gmpclient.org>2014-05-18 12:11:02 +0200
commit34aca6a140b40d58d1f131080790c001b4ee8143 (patch)
treeecd825cbadf6450e959170dcca9a96a68e98952d /source
parent46728d90300f615e20a1cf377601fa36fb8f09cf (diff)
Add double tab mode switching.
If no hit is found, and you press tab twice in a row, switch to next modi.
Diffstat (limited to 'source')
-rw-r--r--source/rofi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/rofi.c b/source/rofi.c
index adca57df..14c36dfa 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -1245,6 +1245,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
// if grabbing keyboard failed, fall through
if(take_keyboard ( box ))
{
+ KeySym prev_key = 0;
unsigned int selected = 0;
for (;; )
{
@@ -1464,6 +1465,13 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
textbox_cursor_end ( text );
free ( str );
}
+ // Double tab!
+ else if (filtered_lines == 0 && key == prev_key )
+ {
+ retv = MENU_NEXT;
+ *selected_line = 0;
+ break;
+ }
else
{
selected = selected < filtered_lines - 1 ? MIN ( filtered_lines - 1, selected + 1 ) : 0;
@@ -1478,6 +1486,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
menu_set_arrow_text(filtered_lines, selected,
max_lines, arrowbox_top,
arrowbox_bottom);
+ prev_key = key;
}
}