aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-01 19:03:49 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-02 00:03:53 +0100
commit800bbd8a13ccee0a82b61a47a04b01d1b2b68976 (patch)
tree9cfe58b69627fb8821247f47404acac1e5bd8b08
parenta399be7f24d58080282316d1ec529bf5aed67634 (diff)
downloadsciteco-800bbd8a13ccee0a82b61a47a04b01d1b2b68976.tar.gz
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.
-rw-r--r--src/cmdline.cpp4
-rw-r--r--src/interface-curses.cpp6
2 files changed, 9 insertions, 1 deletions
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 <CTRL/C> handling */