diff --git a/src/browser.c b/src/browser.c index 4d784bdeb907134b2e75b11aa0ad359578706018..23b310269615586a1a82119490b258d98b7e9309 100644 --- a/src/browser.c +++ b/src/browser.c @@ -149,7 +149,7 @@ char *do_browser(char *path) /* If we selected the same filename as last time, fake a * press of the Enter key so that the file is read in. */ if (old_selected == selected) - unget_kbinput(sc_seq_or(do_enter, 0), FALSE, FALSE); + unget_kbinput(sc_seq_or(do_enter, 0), FALSE); } continue; diff --git a/src/proto.h b/src/proto.h index 58f7fad829173142f6a78cbbcce71b7ba84bb37f..1da247083105c69742912b31f93e7137227fbe6b 100644 --- a/src/proto.h +++ b/src/proto.h @@ -763,7 +763,7 @@ void dump_filestruct_reverse(void); void get_key_buffer(WINDOW *win); size_t get_key_buffer_len(void); void unget_input(int *input, size_t input_len); -void unget_kbinput(int kbinput, bool metakey, bool funckey); +void unget_kbinput(int kbinput, bool metakey); int *get_input(WINDOW *win, size_t input_len); int get_kbinput(WINDOW *win); int parse_kbinput(WINDOW *win); diff --git a/src/text.c b/src/text.c index 36cc90e1cc074355a944afea9906198643793547..dbad310c39bbe0ff45bdad46841285eb5bc57c83 100644 --- a/src/text.c +++ b/src/text.c @@ -2559,7 +2559,7 @@ void do_justify(bool full_justify) } } else { /* Put the keystroke back into the queue. */ - unget_kbinput(kbinput, meta_key, func_key); + unget_kbinput(kbinput, meta_key); /* Set the desired screen column (always zero, except at EOF). */ openfile->placewewant = xplustabs(); diff --git a/src/winio.c b/src/winio.c index f98117b08a5daa031d8bdd048ec213184bef9eb7..0cfe272421723a55fc37780218e5764b2ed3da0f 100644 --- a/src/winio.c +++ b/src/winio.c @@ -248,15 +248,10 @@ void unget_input(int *input, size_t input_len) memcpy(key_buffer, input, input_len * sizeof(int)); } -/* Put back the character stored in kbinput, putting it in byte range - * beforehand. If metakey is TRUE, put back the Escape character after - * putting back kbinput. If funckey is TRUE, put back the function key - * (a value outside byte range) without putting it in byte range. */ -void unget_kbinput(int kbinput, bool metakey, bool funckey) +/* Put the character given in kbinput back into the input stream. If it + * is a Meta key, also insert an Escape character in front of it. */ +void unget_kbinput(int kbinput, bool metakey) { - if (!funckey) - kbinput = (char)kbinput; - unget_input(&kbinput, 1); if (metakey) { @@ -1563,7 +1558,7 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) /* And put the corresponding key into the keyboard buffer. */ if (f != NULL) { const sc *s = first_sc_for(currmenu, f->scfunc); - unget_kbinput(s->seq, s->type == META, s->type == DIRECT); + unget_kbinput(s->seq, s->type == META); } return 1; } else @@ -1591,7 +1586,7 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) * wheel is equivalent to moving down three lines. */ for (i = 0; i < 3; i++) unget_kbinput((mevent.bstate & BUTTON4_PRESSED) ? - KEY_PPAGE : KEY_NPAGE, FALSE, FALSE); + KEY_PPAGE : KEY_NPAGE, FALSE); return 1; } else