Lines Matching +full:key +full:- +full:down
1 // SPDX-License-Identifier: GPL-2.0
15 #include "mnconf-common.h"
21 "------------\n"
32 "------------\n"
34 "build. Kernel features can either be built-in, modularized, or removed.\n"
41 " - - are selected by another feature\n"
48 "<n> to remove it. You may press the <Space> key to cycle through the\n"
51 "A trailing \"--->\" designates a submenu, a trailing \"----\" an\n"
55 "----------------------------------------------------------------------\n"
57 "Linewise down <Down> <j>\n"
59 "Pagewise down <Page Down>\n"
67 "Start incremental, case-insensitive search for STRING in menu entries,\n"
71 " Jump to next hit <Down>\n"
77 "----------------------------------------------------------------------\n"
79 "Unless in a data entry window, key <1> may be used instead of <F1>,\n"
84 "-----------------------\n"
90 "----------\n"
96 "----------------------\n"
103 "-----------------------------\n"
110 "----------------------\n"
121 "----------------\n"
130 "leading \"++>\" and unfolded entries by a leading \"-->\".\n"
136 "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
137 "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
140 "Move up or down with <Up> and <Down>.\n"
150 "For verbose global help use key <1>.\n"
153 "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
154 "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
157 "Move up or down with <Up> or <Down>.\n"
169 "Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n"
216 "-----------------------------------------------------------------\n"
222 " -> Bus options (PCI, PCMCIA, EISA, ISA)\n"
223 " -> PCI support (PCI [ = y])\n"
224 "(1) -> PCI access mode (<choice> [ = y])\n"
227 "-----------------------------------------------------------------\n"
239 " Press the key in the (#) prefix to jump directly to that\n"
295 typedef void (*function_key_handler_t)(int *key, struct menu *menu);
296 static void handle_f1(int *key, struct menu *current_item);
297 static void handle_f2(int *key, struct menu *current_item);
298 static void handle_f3(int *key, struct menu *current_item);
299 static void handle_f4(int *key, struct menu *current_item);
300 static void handle_f5(int *key, struct menu *current_item);
301 static void handle_f6(int *key, struct menu *current_item);
302 static void handle_f7(int *key, struct menu *current_item);
303 static void handle_f8(int *key, struct menu *current_item);
304 static void handle_f9(int *key, struct menu *current_item);
309 function_key key; member
318 .key = F_HELP,
324 .key = F_SYMBOL,
330 .key = F_INSTS,
336 .key = F_CONF,
342 .key = F_BACK,
348 .key = F_SAVE,
354 .key = F_LOAD,
360 .key = F_SEARCH,
366 .key = F_EXIT,
380 mvwprintw(main_window, lines-3, offset, in print_function_line()
385 mvwprintw(main_window, lines-3, in print_function_line()
394 static void handle_f1(int *key, struct menu *current_item) in handle_f1() argument
402 static void handle_f2(int *key, struct menu *current_item) in handle_f2() argument
409 static void handle_f3(int *key, struct menu *current_item) in handle_f3() argument
418 static void handle_f4(int *key, struct menu *current_item) in handle_f4() argument
434 static void handle_f5(int *key, struct menu *current_item) in handle_f5() argument
436 *key = KEY_LEFT; in handle_f5()
441 static void handle_f6(int *key, struct menu *current_item) in handle_f6() argument
448 static void handle_f7(int *key, struct menu *current_item) in handle_f7() argument
455 static void handle_f8(int *key, struct menu *current_item) in handle_f8() argument
462 static void handle_f9(int *key, struct menu *current_item) in handle_f9() argument
468 /* return != 0 to indicate the key was handles */
469 static int process_special_keys(int *key, struct menu *menu) in process_special_keys() argument
473 if (*key == KEY_RESIZE) { in process_special_keys()
479 if (*key == KEY_F(function_keys[i].key) || in process_special_keys()
480 *key == '0' + function_keys[i].key){ in process_special_keys()
481 function_keys[i].handler(key, menu); in process_special_keys()
502 /* return the index of the matched item, or -1 if no such item exists */
510 return -1; in get_mext_match()
515 --match_start; in get_mext_match()
525 --index; in get_mext_match()
530 return -1; in get_mext_match()
539 if (items_num > MAX_MENU_ITEMS-1) in item_make()
578 int index = items_num-1; in item_add_str()
612 return mcur->tag; in item_tag()
629 return mcur->usrptr; in item_data()
642 snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", in set_config_filename()
643 config_filename, rootmenu.prompt->text); in set_config_filename()
649 * -1 means go on doing what you were doing
666 return -1; in do_exit()
747 selected_conf(data.target->parent, data.target); in search_conf()
769 sym = menu->sym; in build_conf()
770 prop = menu->prompt; in build_conf()
775 ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; in build_conf()
782 menu->data ? "-->" : "++>", in build_conf()
788 menu_is_empty(menu) ? "----" : "--->"); in build_conf()
790 if (single_menu_mode && menu->data) in build_conf()
805 item_make(menu, ':', "---%*c%s", in build_conf()
821 for (child = menu->list; child; child = child->next) { in build_conf()
822 if (menu_is_visible(child) && child->sym == def_sym) in build_conf()
858 item_add_str(" --->"); in build_conf()
859 if (def_menu->list) { in build_conf()
862 indent -= 2; in build_conf()
870 "---%*c%s", indent + 1, in build_conf()
885 item_make(menu, 't', "-%c-", in build_conf()
901 if (sym->rev_dep.tri == mod) in build_conf()
908 item_make(menu, 't', "-%c-", ch); in build_conf()
914 tmp = indent - tmp + 4; in build_conf()
929 if (menu->prompt && menu->prompt->type == P_MENU) { in build_conf()
930 item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); in build_conf()
937 for (child = menu->list; child; child = child->next) in build_conf()
939 indent -= doint; in build_conf()
958 toprow = max(selected_index-mwin_max_lines/2, 0); in center_item()
959 if (toprow >= item_count(curses_menu)-mwin_max_lines) in center_item()
960 toprow = item_count(curses_menu)-mwin_max_lines; in center_item()
994 maxx = min(maxx, mwin_max_cols-2); in show_menu()
1000 (mwin_max_cols-maxx)/2); in show_menu()
1037 /* Return 0 means I have handled the key. In such a case, ans should hold the
1038 * item to center, or -1 otherwise.
1039 * Else return -1 .
1041 static int do_match(int key, struct match_state *state, int *ans) in do_match() argument
1043 char c = (char) key; in do_match()
1045 *ans = -1; in do_match()
1046 if (key == '/' || (state->in_search && key == 27)) { in do_match()
1050 state->in_search = 1-state->in_search; in do_match()
1051 bzero(state->pattern, sizeof(state->pattern)); in do_match()
1052 state->match_direction = MATCH_TINKER_PATTERN_DOWN; in do_match()
1054 } else if (!state->in_search) in do_match()
1058 state->pattern[strlen(state->pattern)] = c; in do_match()
1059 state->pattern[strlen(state->pattern)] = '\0'; in do_match()
1060 adj_match_dir(&state->match_direction); in do_match()
1061 *ans = get_mext_match(state->pattern, in do_match()
1062 state->match_direction); in do_match()
1063 } else if (key == KEY_DOWN) { in do_match()
1064 state->match_direction = FIND_NEXT_MATCH_DOWN; in do_match()
1065 *ans = get_mext_match(state->pattern, in do_match()
1066 state->match_direction); in do_match()
1067 } else if (key == KEY_UP) { in do_match()
1068 state->match_direction = FIND_NEXT_MATCH_UP; in do_match()
1069 *ans = get_mext_match(state->pattern, in do_match()
1070 state->match_direction); in do_match()
1071 } else if (key == KEY_BACKSPACE || key == 8 || key == 127) { in do_match()
1072 state->pattern[strlen(state->pattern)-1] = '\0'; in do_match()
1073 adj_match_dir(&state->match_direction); in do_match()
1078 state->in_search = 0; in do_match()
1079 bzero(state->pattern, sizeof(state->pattern)); in do_match()
1083 return -1; in do_match()
1118 if ((struct menu *) mcur->usrptr == active_menu) { in selected_conf()
1140 if (current_index != -1) in selected_conf()
1197 sym = submenu->sym; in selected_conf()
1211 submenu->data = in selected_conf()
1212 (void *) (long) !submenu->data; in selected_conf()
1220 else if (submenu->prompt && in selected_conf()
1221 submenu->prompt->type == P_MENU) in selected_conf()
1283 active = sym_get_choice_value(menu->sym); in conf_choice()
1288 for (i = 0, child = menu->list; child; child = child->next) { in conf_choice()
1292 if (child->sym == sym_get_choice_value(menu->sym)) in conf_choice()
1295 else if (child->sym) in conf_choice()
1302 if (child->sym == active){ in conf_choice()
1323 if (selected_index != -1) in conf_choice()
1369 if (!child || !menu_is_visible(child) || !child->sym) in conf_choice()
1375 sym_set_tristate_value(child->sym, yes); in conf_choice()
1380 active = child->sym; in conf_choice()
1396 switch (sym_get_type(menu->sym)) { in conf_string()
1412 sym_get_string_value(menu->sym), in conf_string()
1417 if (sym_set_string_value(menu->sym, in conf_string()
1505 main_window = newwin(lines-2, columns-2, 2, 1); in setup_windows()
1507 mwin_max_lines = lines-7; in setup_windows()
1508 mwin_max_cols = columns-6; in setup_windows()
1519 if (ac > 1 && strcmp(av[1], "-s") == 0) { in main()