From 800bbd8a13ccee0a82b61a47a04b01d1b2b68976 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 1 Mar 2015 19:03:49 +0100 Subject: fixed function key handling on GTK UI * we cannot prevent GTK from delivering the function key presses, as we can on Curses. Therefore Cmdline::fnmacro() checks again if function keys are enabled. --- src/cmdline.cpp | 4 +++- src/interface-curses.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cmdline.cpp b/src/cmdline.cpp index 599a469..d659a0b 100644 --- a/src/cmdline.cpp +++ b/src/cmdline.cpp @@ -488,7 +488,9 @@ Cmdline::process_edit_cmd(gchar key) void Cmdline::fnmacro(const gchar *name) { - /* FIXME: check again if function keys are enabled */ + if (!(Flags::ed & Flags::ED_FNKEYS)) + return; + gchar macro_name[1 + strlen(name) + 1]; QRegister *reg; diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp index 1f4506a..dd08e8f 100644 --- a/src/interface-curses.cpp +++ b/src/interface-curses.cpp @@ -484,6 +484,12 @@ event_loop_iter() { int key; + /* + * Setting function key processing is important + * on Unix Curses, as ESCAPE is handled as the beginning + * of a escape sequence when terminal emulators are + * involved. + */ keypad(interface.cmdline_window, Flags::ed & Flags::ED_FNKEYS); /* no special handling */ -- cgit v1.2.3