mirror of
https://github.com/davatorium/rofi.git
synced 2025-03-03 16:05:20 -05:00
Force custom commandline when Ctrl-Return is used
This commit is contained in:
parent
edbeaf1790
commit
21235b0600
2 changed files with 8 additions and 1 deletions
|
@ -1650,10 +1650,14 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a valid item is selected, return that..
|
// If a valid item is selected, return that..
|
||||||
if ( state.selected < state.filtered_lines && state.filtered[state.selected] != NULL ) {
|
if ( rc != -2
|
||||||
|
&& state.selected < state.filtered_lines && state.filtered[state.selected] != NULL ) {
|
||||||
state.retv = MENU_OK;
|
state.retv = MENU_OK;
|
||||||
*( state.selected_line ) = state.line_map[state.selected];
|
*( state.selected_line ) = state.line_map[state.selected];
|
||||||
}
|
}
|
||||||
|
// Either:
|
||||||
|
// Ctrl+Enter was used to force using custom input (-2)
|
||||||
|
// or
|
||||||
// No item selected, but user entered something
|
// No item selected, but user entered something
|
||||||
else if ( strlen ( state.text->text ) > 0 ) {
|
else if ( strlen ( state.text->text ) > 0 ) {
|
||||||
state.retv = MENU_CUSTOM_INPUT;
|
state.retv = MENU_CUSTOM_INPUT;
|
||||||
|
|
|
@ -405,6 +405,9 @@ int textbox_keypress ( textbox *tb, XEvent *ev )
|
||||||
textbox_cursor_bkspc ( tb );
|
textbox_cursor_bkspc ( tb );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else if ( ( ev->xkey.state & ControlMask ) && key == XK_Return || key == XK_KP_Enter ) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
else if ( key == XK_Return || key == XK_KP_Enter ||
|
else if ( key == XK_Return || key == XK_KP_Enter ||
|
||||||
( ( ev->xkey.state & ControlMask ) && key == XK_j ) ||
|
( ( ev->xkey.state & ControlMask ) && key == XK_j ) ||
|
||||||
( ( ev->xkey.state & ControlMask ) && key == XK_m ) ) {
|
( ( ev->xkey.state & ControlMask ) && key == XK_m ) ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue