From 04e557fdafadc5bce0262ed9d4a853df6d0adc15 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 17 Jan 2020 17:06:17 +0100 Subject: [PATCH] tweaks: avoid fiddling with the keybuffer when it's not needed Just change KEY_MOUSE directly into KEY_ENTER for a double click. --- src/browser.c | 5 +++-- src/proto.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/browser.c b/src/browser.c index 80b250c9..adfee07c 100644 --- a/src/browser.c +++ b/src/browser.c @@ -138,10 +138,11 @@ 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(KEY_ENTER, FALSE); + kbinput = KEY_ENTER; } - continue; + if (kbinput == KEY_MOUSE) + continue; } #endif /* ENABLE_MOUSE */ diff --git a/src/proto.h b/src/proto.h index 14765e10..ba061829 100644 --- a/src/proto.h +++ b/src/proto.h @@ -608,7 +608,6 @@ void record_macro(void); void run_macro(void); size_t get_key_buffer_len(void); void put_back(int keycode); -void unget_kbinput(int kbinput, bool metakey); #ifdef ENABLE_NANORC void implant(const char *string); #endif