diff options
author | 2014-10-25 00:30:36 -0400 | |
---|---|---|
committer | 2014-10-25 00:30:36 -0400 | |
commit | 83c20c89439386f31050718c94551d863298cdb9 (patch) | |
tree | 536dd52392df00ded7bbc5f650ea0eb0d397d52d /src/cdk.patch | |
parent | 1de8c1bb596a7dbff39ab55685ead31a5d0c9373 (diff) | |
download | textadept-83c20c89439386f31050718c94551d863298cdb9.tar.gz textadept-83c20c89439386f31050718c94551d863298cdb9.zip |
Improvements to terminal mouse handling.
Emit events for unhandled mouse events and connect to such events in order to
focus and resize views.
Patch libtermkey with new Win32 PDCurses driver for unified key/mouse input.
Update CDK patch to always use libtermkey and to ignore mouse events.
Requires Scinterm r97 (changeset 8d1a625c9b4d).
Thanks to Chris Emerson for proof of concept code that handles mouse events and
for the code that focuses and resizes views.
Diffstat (limited to 'src/cdk.patch')
-rw-r--r-- | src/cdk.patch | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/cdk.patch b/src/cdk.patch index b9fc42b9..20ab9227 100644 --- a/src/cdk.patch +++ b/src/cdk.patch @@ -1,24 +1,24 @@ diff -r 9d0780ddcbab binding.c --- a/binding.c 2011-05-16 18:36:08.000000000 -0400 +++ b/binding.c 2013-12-18 11:51:43.781198100 -0500 -@@ -1,4 +1,8 @@ +@@ -1,4 +1,6 @@ #include <cdk_int.h> -+#if !_WIN32 +#include "termkey.h" +extern TermKey *ta_tk; -+#endif /* * $Author: tom $ -@@ -167,7 +171,47 @@ +@@ -167,7 +169,47 @@ { EObjectType cdktype = ObjTypeOf (obj); CDKOBJS *test = bindableObject (&cdktype, obj); -+#if !_WIN32 +- int result = wgetch (InputWindowOf (obj)); + int result = ERR; + TermKeyKey key; + int keysyms[] = {0,KEY_BACKSPACE,KEY_TAB,KEY_ENTER,KEY_ESC,0,0,KEY_UP,KEY_DOWN,KEY_LEFT,KEY_RIGHT,0,0,KEY_IC,KEY_DC,0,KEY_PPAGE,KEY_NPAGE,KEY_HOME,KEY_END}; -+ TermKeyResult res = termkey_waitkey(ta_tk, &key); ++ TermKeyResult res; ++retry: ++ res = termkey_waitkey(ta_tk, &key); + switch (res) + { + case TERMKEY_RES_KEY: @@ -39,6 +39,8 @@ diff -r 9d0780ddcbab binding.c + case TERMKEY_TYPE_KEYSYM: + result = keysyms[key.code.sym]; + break; ++ case TERMKEY_TYPE_MOUSE: ++ goto retry; + default: + result = ERR; + } @@ -52,9 +54,6 @@ diff -r 9d0780ddcbab binding.c + result = 0; + break; + } -+#else - int result = wgetch (InputWindowOf (obj)); -+#endif if (result >= 0 && test != 0 |