Lines Matching +full:key +full:- +full:press

1 // SPDX-License-Identifier: GPL-2.0
17 #include "mnconf-common.h"
23 "------------\n"
30 " of <?> <h>, or if in a data entry window then press <F1>.\n"
34 "------------\n"
36 "build. Kernel features can either be built-in, modularized, or removed.\n"
43 " - - are selected by another feature\n"
49 "listed below and press <y> to build it in, <m> to make it a module or\n"
50 "<n> to remove it. You may press the <Space> key to cycle through the\n"
53 "A trailing \"--->\" designates a submenu, a trailing \"----\" an\n"
57 "----------------------------------------------------------------------\n"
69 "Start incremental, case-insensitive search for STRING in menu entries,\n"
79 "----------------------------------------------------------------------\n"
81 "Unless in a data entry window, key <1> may be used instead of <F1>,\n"
86 "-----------------------\n"
88 "and press <Space>.\n"
92 "----------\n"
93 "Enter the requested information and press <Enter>. Hexadecimal values\n"
98 "----------------------\n"
101 "Press any of <Enter> <Esc> <q> <F5> <F9> to exit.\n"
105 "-----------------------------\n"
107 "Press <F6> to save your current configuration. Press <F7> and enter\n"
112 "----------------------\n"
123 "----------------\n"
132 "leading \"++>\" and unfolded entries by a leading \"-->\".\n"
138 "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
139 "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
147 "To search for menu entries press </>.\n"
151 "Press <1> instead of <F1>, <2> instead of <F2>, etc.\n"
152 "For verbose global help use key <1>.\n"
153 "For help related to the current menu entry press <?> or <h>.\n",
155 "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
156 "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
164 "To search for menu entries press </>.\n"
168 "For verbose global help press <F1>.\n"
169 "For help related to the current menu entry press <?> or <h>.\n",
171 "Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n"
173 "For help related to the current entry press <?> or <h>.\n"
174 "For global help press <F1>.\n",
178 "Press <Enter> to apply, <Esc> to cancel.",
181 "Press <Enter> to apply, <Esc> to cancel.",
184 "Press <Enter> to apply, <Esc> to cancel.",
218 "-----------------------------------------------------------------\n"
224 " -> Bus options (PCI, PCMCIA, EISA, ISA)\n"
225 " -> PCI support (PCI [ = y])\n"
226 "(1) -> PCI access mode (<choice> [ = y])\n"
229 "-----------------------------------------------------------------\n"
241 " Press the key in the (#) prefix to jump directly to that\n"
297 typedef void (*function_key_handler_t)(int *key, struct menu *menu);
298 static void handle_f1(int *key, struct menu *current_item);
299 static void handle_f2(int *key, struct menu *current_item);
300 static void handle_f3(int *key, struct menu *current_item);
301 static void handle_f4(int *key, struct menu *current_item);
302 static void handle_f5(int *key, struct menu *current_item);
303 static void handle_f6(int *key, struct menu *current_item);
304 static void handle_f7(int *key, struct menu *current_item);
305 static void handle_f8(int *key, struct menu *current_item);
306 static void handle_f9(int *key, struct menu *current_item);
311 function_key key; member
320 .key = F_HELP,
326 .key = F_SYMBOL,
332 .key = F_INSTS,
338 .key = F_CONF,
344 .key = F_BACK,
350 .key = F_SAVE,
356 .key = F_LOAD,
362 .key = F_SEARCH,
368 .key = F_EXIT,
382 mvwprintw(main_window, lines-3, offset, in print_function_line()
387 mvwprintw(main_window, lines-3, in print_function_line()
396 static void handle_f1(int *key, struct menu *current_item) in handle_f1() argument
404 static void handle_f2(int *key, struct menu *current_item) in handle_f2() argument
411 static void handle_f3(int *key, struct menu *current_item) in handle_f3() argument
420 static void handle_f4(int *key, struct menu *current_item) in handle_f4() argument
436 static void handle_f5(int *key, struct menu *current_item) in handle_f5() argument
438 *key = KEY_LEFT; in handle_f5()
443 static void handle_f6(int *key, struct menu *current_item) in handle_f6() argument
450 static void handle_f7(int *key, struct menu *current_item) in handle_f7() argument
457 static void handle_f8(int *key, struct menu *current_item) in handle_f8() argument
464 static void handle_f9(int *key, struct menu *current_item) in handle_f9() argument
470 /* return != 0 to indicate the key was handles */
471 static int process_special_keys(int *key, struct menu *menu) in process_special_keys() argument
475 if (*key == KEY_RESIZE) { in process_special_keys()
481 if (*key == KEY_F(function_keys[i].key) || in process_special_keys()
482 *key == '0' + function_keys[i].key){ in process_special_keys()
483 function_keys[i].handler(key, menu); in process_special_keys()
504 /* return the index of the matched item, or -1 if no such item exists */
512 return -1; in get_mext_match()
517 --match_start; in get_mext_match()
527 --index; in get_mext_match()
532 return -1; in get_mext_match()
541 if (items_num > MAX_MENU_ITEMS-1) in item_make()
580 int index = items_num-1; in item_add_str()
614 return mcur->tag; in item_tag()
631 return mcur->usrptr; in item_data()
644 snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", in set_config_filename()
645 config_filename, rootmenu.prompt->text); in set_config_filename()
651 * -1 means go on doing what you were doing
668 return -1; in do_exit()
749 selected_conf(data.target->parent, data.target); in search_conf()
771 sym = menu->sym; in build_conf()
772 prop = menu->prompt; in build_conf()
777 ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; in build_conf()
784 menu->data ? "-->" : "++>", in build_conf()
790 menu_is_empty(menu) ? "----" : "--->"); in build_conf()
792 if (single_menu_mode && menu->data) in build_conf()
807 item_make(menu, ':', "---%*c%s", in build_conf()
823 for (child = menu->list; child; child = child->next) { in build_conf()
824 if (menu_is_visible(child) && child->sym == def_sym) in build_conf()
834 item_add_str(" (%s) --->", menu_get_prompt(def_menu)); in build_conf()
839 "---%*c%s", indent + 1, in build_conf()
851 item_make(menu, 't', "-%c-", in build_conf()
867 if (sym->rev_dep.tri == mod) in build_conf()
872 item_make(menu, 't', "-%c-", ch); in build_conf()
878 tmp = indent - tmp + 4; in build_conf()
890 if (menu->prompt && menu->prompt->type == P_MENU) { in build_conf()
891 item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); in build_conf()
898 for (child = menu->list; child; child = child->next) in build_conf()
900 indent -= doint; in build_conf()
919 toprow = max(selected_index-mwin_max_lines/2, 0); in center_item()
920 if (toprow >= item_count(curses_menu)-mwin_max_lines) in center_item()
921 toprow = item_count(curses_menu)-mwin_max_lines; in center_item()
955 maxx = min(maxx, mwin_max_cols-2); in show_menu()
961 (mwin_max_cols-maxx)/2); in show_menu()
998 /* Return 0 means I have handled the key. In such a case, ans should hold the
999 * item to center, or -1 otherwise.
1000 * Else return -1 .
1002 static int do_match(int key, struct match_state *state, int *ans) in do_match() argument
1004 char c = (char) key; in do_match()
1006 *ans = -1; in do_match()
1007 if (key == '/' || (state->in_search && key == 27)) { in do_match()
1011 state->in_search = 1-state->in_search; in do_match()
1012 bzero(state->pattern, sizeof(state->pattern)); in do_match()
1013 state->match_direction = MATCH_TINKER_PATTERN_DOWN; in do_match()
1015 } else if (!state->in_search) in do_match()
1019 state->pattern[strlen(state->pattern)] = c; in do_match()
1020 state->pattern[strlen(state->pattern)] = '\0'; in do_match()
1021 adj_match_dir(&state->match_direction); in do_match()
1022 *ans = get_mext_match(state->pattern, in do_match()
1023 state->match_direction); in do_match()
1024 } else if (key == KEY_DOWN) { in do_match()
1025 state->match_direction = FIND_NEXT_MATCH_DOWN; in do_match()
1026 *ans = get_mext_match(state->pattern, in do_match()
1027 state->match_direction); in do_match()
1028 } else if (key == KEY_UP) { in do_match()
1029 state->match_direction = FIND_NEXT_MATCH_UP; in do_match()
1030 *ans = get_mext_match(state->pattern, in do_match()
1031 state->match_direction); in do_match()
1032 } else if (key == KEY_BACKSPACE || key == 8 || key == 127) { in do_match()
1033 state->pattern[strlen(state->pattern)-1] = '\0'; in do_match()
1034 adj_match_dir(&state->match_direction); in do_match()
1039 state->in_search = 0; in do_match()
1040 bzero(state->pattern, sizeof(state->pattern)); in do_match()
1044 return -1; in do_match()
1079 if ((struct menu *) mcur->usrptr == active_menu) { in selected_conf()
1101 if (current_index != -1) in selected_conf()
1158 sym = submenu->sym; in selected_conf()
1172 submenu->data = in selected_conf()
1173 (void *) (long) !submenu->data; in selected_conf()
1180 else if (submenu->prompt && in selected_conf()
1181 submenu->prompt->type == P_MENU) in selected_conf()
1248 for (i = 0, child = menu->list; child; child = child->next) { in conf_choice()
1252 if (child->sym == sym_calc_choice(menu)) in conf_choice()
1255 else if (child->sym) in conf_choice()
1262 if (child->sym == active){ in conf_choice()
1283 if (selected_index != -1) in conf_choice()
1329 if (!child || !menu_is_visible(child) || !child->sym) in conf_choice()
1335 choice_set_value(menu, child->sym); in conf_choice()
1340 active = child->sym; in conf_choice()
1356 switch (sym_get_type(menu->sym)) { in conf_string()
1372 sym_get_string_value(menu->sym), in conf_string()
1377 if (sym_set_string_value(menu->sym, in conf_string()
1465 main_window = newwin(lines-2, columns-2, 2, 1); in setup_windows()
1467 mwin_max_lines = lines-7; in setup_windows()
1468 mwin_max_cols = columns-6; in setup_windows()
1479 if (ac > 1 && strcmp(av[1], "-s") == 0) { in main()