Add ctrl-(shift)-tab for switching modi.

This commit is contained in:
Dave Davenport 2015-03-12 17:57:00 +01:00
parent 42b86015c3
commit 4579a62b2d
4 changed files with 19 additions and 0 deletions

View File

@ -1,6 +1,8 @@
0.15.3: (unreleased)
New feature:
- Number mode for dmenu. allows user to get index back instead of content.
Improvements:
- Add Ctrl(Shift)Tab to switch modi's.
Cleanup:
- Do not lug argc,argv around everywhere.

View File

@ -451,6 +451,8 @@ Rofi supports the following keybindings:
* `Shift-Enter`: Return the selected entry and move to the next item while keeping Rofi open. (in dmenu)
* `Shift-Right`: Switch to the next modi. The list can be customized with the `-switchers` argument.
* `Shift-Left`: Switch to the previous modi. The list can be customized with the `-switchers` argument.
* `Ctrl-Tab`: Switch to the next modi. The list can be customized with the `-switchers` argument.
* `Ctrl-Shift-Tab`: Switch to the previous modi. The list can be customized with the `-switchers` argument.
* `Ctrl-space`: Set selected item as input text.
* `Shift-Del`: Delete entry from history.
* `grave`: Toggle case sensitivity.

View File

@ -577,6 +577,10 @@ Rofi supports the following keybindings:
.IP \(bu 2
\fB\fCShift\-Left\fR: Switch to the previous modi. The list can be customized with the \fB\fC\-switchers\fR argument.
.IP \(bu 2
\fB\fCCtrl\-Tab\fR: Switch to the next modi. The list can be customized with the \fB\fC\-switchers\fR argument.
.IP \(bu 2
\fB\fCCtrl\-Shift\-Tab\fR: Switch to the previous modi. The list can be customized with the \fB\fC\-switchers\fR argument.
.IP \(bu 2
\fB\fCCtrl\-space\fR: Set selected item as input text.
.IP \(bu 2
\fB\fCShift\-Del\fR: Delete entry from history.

View File

@ -1144,6 +1144,17 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
state.quit = TRUE;
break;
}
else if ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_Tab ) {
if ( ( ev.xkey.state & ShiftMask ) == ShiftMask ) {
state.retv = MENU_PREVIOUS;
}
else{
state.retv = MENU_NEXT;
}
*( state.selected_line ) = 0;
state.quit = TRUE;
break;
}
// Menu navigation.
else if ( ( ( ev.xkey.state & ShiftMask ) == ShiftMask ) &&
key == XK_Right ) {