old_selected = selected;
kbinput = get_kbinput(edit, &meta_key, &func_key);
- parse_browser_input(&kbinput, &meta_key, &func_key);
- s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
- if (!s)
- continue;
- f = sctofunc((sc *) s);
- if (!f)
- break;
+
#ifndef DISABLE_MOUSE
- if (f->scfunc == (void *) do_mouse) {
+ if (kbinput == KEY_MOUSE) {
int mouse_x, mouse_y;
if (old_selected == selected)
unget_kbinput(NANO_ENTER_KEY, FALSE, FALSE);
}
- } else
+ }
#endif /* !DISABLE_MOUSE */
+
+ parse_browser_input(&kbinput, &meta_key, &func_key);
+ s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
+ if (!s)
+ continue;
+ f = sctofunc((sc *) s);
+ if (!f)
+ break;
+
if (f->scfunc == total_refresh) {
total_redraw();
} else if (f->scfunc == do_help_void) {
old_line = line;
kbinput = get_kbinput(edit, &meta_key, &func_key);
- parse_help_input(&kbinput, &meta_key, &func_key);
+#ifndef DISABLE_MOUSE
+ if (kbinput == KEY_MOUSE) {
+ int mouse_x, mouse_y;
+ get_mouseinput(&mouse_x, &mouse_y, TRUE);
+ continue;
+ /* Redraw the screen. */
+ }
+#endif
+
+ parse_help_input(&kbinput, &meta_key, &func_key);
s = get_shortcut(MHELP, &kbinput, &meta_key, &func_key);
if (!s)
continue;
if (!f)
continue;
-
- if (f->scfunc == (void *) do_mouse) {
-#ifndef DISABLE_MOUSE
- int mouse_x, mouse_y;
-
- get_mouseinput(&mouse_x, &mouse_y, TRUE);
-#endif
- /* Redraw the screen. */
- } else if (f->scfunc == total_refresh) {
+ if (f->scfunc == total_refresh) {
total_redraw();
break;
} else if (f->scfunc == do_page_up) {
* we released/clicked on. */
f = allfuncs;
- for (; j > 0; j--)
- while (f != NULL && (f->menus & currmenu) != 0)
+ for (; j > 0; j--) {
+ if (f->next != NULL)
+ f = f->next;
+ while (f->next != NULL && (f->menus & currmenu) == 0)
f = f->next;
+ }
+
/* And put back the equivalent key. */
if (f != NULL) {
const sc *s = first_sc_for(currmenu, (void *) f->scfunc);
- unget_kbinput(s->seq, s->type == META, FALSE);
+ if (s != NULL)
+ unget_kbinput(s->seq, s->type == META, FALSE);
}
} else
/* Handle releases/clicks of the first mouse button that