1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Fix issue #160. Return selected line.

This commit is contained in:
Dave Davenport 2015-05-06 08:03:10 +02:00
parent 13eee4571c
commit 94c9303d89

View file

@ -1178,46 +1178,73 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
}
}
else if ( abe_test_action ( CUSTOM_1, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 0 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_2, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 1 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_3, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 2 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_4, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 3 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_5, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 4 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_6, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 5 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_7, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 6 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_8, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 7 & MENU_LOWER_MASK );
state.quit = TRUE;
break;
}
else if ( abe_test_action ( CUSTOM_9, ev.xkey.state, key ) ) {
if ( state.selected < state.filtered_lines ) {
*( state.selected_line ) = state.line_map[state.selected];
}
state.retv = MENU_QUICK_SWITCH | ( 8 & MENU_LOWER_MASK );
state.quit = TRUE;
break;