aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-06-22 03:35:12 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-06-22 04:11:23 +0200
commit65a1e6150357599c33824ec99629c3f9556ac750 (patch)
treefb0759e25f300303b89f9c38ca83104d96e762d8 /src/interface-curses.cpp
parent91bbf67eeba0627c684fb4f9e522ac114c456e47 (diff)
downloadsciteco-65a1e6150357599c33824ec99629c3f9556ac750.tar.gz
disable PDCurses/win32a "function keys"
* this fixes the CTRL+V command * PDC_set_function_key() may be used to implement a "shutdown" function key macro later on. * interruptions via CTRL+C are not (easily) possible in this port of PDCurses - similar to XCurses. However, I may ask the author if this is possible.
Diffstat (limited to 'src/interface-curses.cpp')
-rw-r--r--src/interface-curses.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp
index aafab29..e46af51 100644
--- a/src/interface-curses.cpp
+++ b/src/interface-curses.cpp
@@ -96,6 +96,20 @@
namespace SciTECO {
extern "C" {
+
+/*
+ * PDCurses/win32a by default assigns functions to certain
+ * keys like CTRL+V, CTRL++, CTRL+- and CTRL+=.
+ * This conflicts with SciTECO that must remain in control
+ * of keyboard processing.
+ * Unfortunately, the default mapping can only be disabled
+ * or changed via the internal PDC_set_function_key() in
+ * pdcwin.h. Therefore we declare it manually here.
+ */
+#ifdef PDCURSES_WIN32A
+int PDC_set_function_key(const unsigned function, const int new_key);
+#endif
+
static void scintilla_notify(Scintilla *sci, int idFrom,
void *notify, void *user_data);
@@ -256,8 +270,18 @@ InterfaceCurses::init_interactive(void)
#endif
#ifdef PDCURSES_WIN32A
- /* enables window resizing on Win32a port */
+ /*
+ * Necessary to enable window resizing in Win32a port
+ */
PDC_set_resize_limits(25, 0xFFFF, 80, 0xFFFF);
+
+ /*
+ * Disable all magic function keys.
+ * NOTE: This could also be used to assign
+ * a "shutdown" key when program termination is requested.
+ */
+ for (int i = 0; i < 5; i++)
+ PDC_set_function_key(i, 0);
#endif
/* for displaying UTF-8 characters properly */