aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile11
-rw-r--r--src/pdcurses.patch88
-rw-r--r--src/textadept.c6
3 files changed, 100 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index 861e250f..757c51aa 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -374,8 +374,8 @@ gtdialog_zip = db67f8a489e8.zip
cdk_tgz = cdk-5.0-20150928.tgz
termkey_tgz = libtermkey-0.20.tar.gz
win32gtk_zip = win32gtk-2.24.32.zip
-win32curses_zip = win32curses36.zip
-pdcurses_zip = pdcurs36.zip
+win32curses_zip = win32curses39.zip
+pdcurses_zip = PDCurses-3.9.zip
gtkosx_tgz = gtkosx-2.24.31.tar.gz
bombay_zip = bombay.zip
cloc = cloc-1.60.pl
@@ -420,10 +420,11 @@ $(win32gtk_zip): ; $(WGET) http://foicica.com/textadept/download/$@
win32gtk: | $(win32gtk_zip) ; unzip $|
$(win32curses_zip): ; $(WGET) http://foicica.com/textadept/download/$@
$(pdcurses_zip): ; $(WGET) http://prdownloads.sourceforge.net/pdcurses/$@
-win32curses: | $(win32curses_zip) $(pdcurses_zip)
+win32curses: pdcurses.patch | $(win32curses_zip) $(pdcurses_zip)
unzip $(win32curses_zip)
- mkdir $@/src && unzip -d $@/src $(pdcurses_zip)
- cp $@/lib/pdckbd.c $@/src/wincon
+ mkdir $@/src && unzip -d $@/src $(pdcurses_zip) && mv $@/src/*/* $@/src
+ cp $@/src/curses.h $@/include
+ patch -d $@/src -N -p1 < $<
cd $@/src/wincon && $(MAKE) CC="$(CROSS)$(CC) $(CFLAGS)" LIBEXE=$(CROSS)ar \
LINK="$(CROSS)$(CC) $(CFLAGS)" WIDE=Y UTF8=Y libs
cp $@/src/wincon/pdcurses.a $@/lib/
diff --git a/src/pdcurses.patch b/src/pdcurses.patch
new file mode 100644
index 00000000..4e1d663f
--- /dev/null
+++ b/src/pdcurses.patch
@@ -0,0 +1,88 @@
+--- a/wincon/pdckbd.c 2018-01-29 22:49:25.000000000 -0500
++++ b/wincon/pdckbd.c 2018-11-10 21:40:57.000000000 -0500
+@@ -102,16 +102,16 @@
+ {PAD0, 0x30, CTL_PAD0, ALT_PAD0, 11 }, /* 45 VK_INSERT */
+ {PADSTOP, 0x2E, CTL_PADSTOP, ALT_PADSTOP,12 }, /* 46 VK_DELETE */
+ {0, 0, 0, 0, 0 }, /* 47 VK_HELP */
+- {0x30, 0x29, 0, ALT_0, 0 }, /* 48 */
+- {0x31, 0x21, 0, ALT_1, 0 }, /* 49 */
+- {0x32, 0x40, 0, ALT_2, 0 }, /* 50 */
+- {0x33, 0x23, 0, ALT_3, 0 }, /* 51 */
+- {0x34, 0x24, 0, ALT_4, 0 }, /* 52 */
+- {0x35, 0x25, 0, ALT_5, 0 }, /* 53 */
+- {0x36, 0x5E, 0, ALT_6, 0 }, /* 54 */
+- {0x37, 0x26, 0, ALT_7, 0 }, /* 55 */
+- {0x38, 0x2A, 0, ALT_8, 0 }, /* 56 */
+- {0x39, 0x28, 0, ALT_9, 0 }, /* 57 */
++ {0x30, 0x29, 0, 0x30, 0 }, /* 48 */
++ {0x31, 0x21, 0, 0x31, 0 }, /* 49 */
++ {0x32, 0x40, 0, 0x32, 0 }, /* 50 */
++ {0x33, 0x23, 0, 0x33, 0 }, /* 51 */
++ {0x34, 0x24, 0, 0x34, 0 }, /* 52 */
++ {0x35, 0x25, 0, 0x35, 0 }, /* 53 */
++ {0x36, 0x5E, 0, 0x36, 0 }, /* 54 */
++ {0x37, 0x26, 0, 0x37, 0 }, /* 55 */
++ {0x38, 0x2A, 0, 0x38, 0 }, /* 56 */
++ {0x39, 0x28, 0, 0x39, 0 }, /* 57 */
+ {0, 0, 0, 0, 0 }, /* 58 */
+ {0, 0, 0, 0, 0 }, /* 59 */
+ {0, 0, 0, 0, 0 }, /* 60 */
+@@ -119,32 +119,32 @@
+ {0, 0, 0, 0, 0 }, /* 62 */
+ {0, 0, 0, 0, 0 }, /* 63 */
+ {0, 0, 0, 0, 0 }, /* 64 */
+- {0x61, 0x41, 0x01, ALT_A, 0 }, /* 65 */
+- {0x62, 0x42, 0x02, ALT_B, 0 }, /* 66 */
+- {0x63, 0x43, 0x03, ALT_C, 0 }, /* 67 */
+- {0x64, 0x44, 0x04, ALT_D, 0 }, /* 68 */
+- {0x65, 0x45, 0x05, ALT_E, 0 }, /* 69 */
+- {0x66, 0x46, 0x06, ALT_F, 0 }, /* 70 */
+- {0x67, 0x47, 0x07, ALT_G, 0 }, /* 71 */
+- {0x68, 0x48, 0x08, ALT_H, 0 }, /* 72 */
+- {0x69, 0x49, 0x09, ALT_I, 0 }, /* 73 */
+- {0x6A, 0x4A, 0x0A, ALT_J, 0 }, /* 74 */
+- {0x6B, 0x4B, 0x0B, ALT_K, 0 }, /* 75 */
+- {0x6C, 0x4C, 0x0C, ALT_L, 0 }, /* 76 */
+- {0x6D, 0x4D, 0x0D, ALT_M, 0 }, /* 77 */
+- {0x6E, 0x4E, 0x0E, ALT_N, 0 }, /* 78 */
+- {0x6F, 0x4F, 0x0F, ALT_O, 0 }, /* 79 */
+- {0x70, 0x50, 0x10, ALT_P, 0 }, /* 80 */
+- {0x71, 0x51, 0x11, ALT_Q, 0 }, /* 81 */
+- {0x72, 0x52, 0x12, ALT_R, 0 }, /* 82 */
+- {0x73, 0x53, 0x13, ALT_S, 0 }, /* 83 */
+- {0x74, 0x54, 0x14, ALT_T, 0 }, /* 84 */
+- {0x75, 0x55, 0x15, ALT_U, 0 }, /* 85 */
+- {0x76, 0x56, 0x16, ALT_V, 0 }, /* 86 */
+- {0x77, 0x57, 0x17, ALT_W, 0 }, /* 87 */
+- {0x78, 0x58, 0x18, ALT_X, 0 }, /* 88 */
+- {0x79, 0x59, 0x19, ALT_Y, 0 }, /* 89 */
+- {0x7A, 0x5A, 0x1A, ALT_Z, 0 }, /* 90 */
++ {0x61, 0x41, 0x01, 0x61, 0 }, /* 65 */
++ {0x62, 0x42, 0x02, 0x62, 0 }, /* 66 */
++ {0x63, 0x43, 0x03, 0x63, 0 }, /* 67 */
++ {0x64, 0x44, 0x04, 0x64, 0 }, /* 68 */
++ {0x65, 0x45, 0x05, 0x65, 0 }, /* 69 */
++ {0x66, 0x46, 0x06, 0x66, 0 }, /* 70 */
++ {0x67, 0x47, 0x07, 0x67, 0 }, /* 71 */
++ {0x68, 0x48, 0x08, 0x68, 0 }, /* 72 */
++ {0x69, 0x49, 0x09, 0x69, 0 }, /* 73 */
++ {0x6A, 0x4A, 0x0A, 0x6A, 0 }, /* 74 */
++ {0x6B, 0x4B, 0x0B, 0x6B, 0 }, /* 75 */
++ {0x6C, 0x4C, 0x0C, 0x6C, 0 }, /* 76 */
++ {0x6D, 0x4D, 0x0D, 0x6D, 0 }, /* 77 */
++ {0x6E, 0x4E, 0x0E, 0x6E, 0 }, /* 78 */
++ {0x6F, 0x4F, 0x0F, 0x6F, 0 }, /* 79 */
++ {0x70, 0x50, 0x10, 0x70, 0 }, /* 80 */
++ {0x71, 0x51, 0x11, 0x71, 0 }, /* 81 */
++ {0x72, 0x52, 0x12, 0x72, 0 }, /* 82 */
++ {0x73, 0x53, 0x13, 0x73, 0 }, /* 83 */
++ {0x74, 0x54, 0x14, 0x74, 0 }, /* 84 */
++ {0x75, 0x55, 0x15, 0x75, 0 }, /* 85 */
++ {0x76, 0x56, 0x16, 0x76, 0 }, /* 86 */
++ {0x77, 0x57, 0x17, 0x77, 0 }, /* 87 */
++ {0x78, 0x58, 0x18, 0x78, 0 }, /* 88 */
++ {0x79, 0x59, 0x19, 0x79, 0 }, /* 89 */
++ {0x7A, 0x5A, 0x1A, 0x7A, 0 }, /* 90 */
+ {0, 0, 0, 0, 0 }, /* 91 VK_LWIN */
+ {0, 0, 0, 0, 0 }, /* 92 VK_RWIN */
+ {0, 0, 0, 0, 0 }, /* 93 VK_APPS */
diff --git a/src/textadept.c b/src/textadept.c
index c0bf836d..28e06ada 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -2504,6 +2504,9 @@ int main(int argc, char **argv) {
sigaction(SIGWINCH, &act, NULL);
#else
freopen("NUL", "w", stderr); // redirect stderr
+#if CURSES
+ freopen("NUL", "w", stdout); // redirect stdout
+#endif
#endif
Scintilla *view = focused_view;
@@ -2575,6 +2578,9 @@ int main(int argc, char **argv) {
} else quit = FALSE;
refresh_all();
view = !command_entry_focused ? focused_view : command_entry;
+#if (_WIN32 && CURSES)
+ mouse_set(ALL_MOUSE_EVENTS); // _popen() and system() change console mode
+#endif
}
endwin();
termkey_destroy(ta_tk);