aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-26 23:38:41 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-26 23:38:41 +0000
commit4d9785c238d848c9e73c00dc90f925c79251a88c (patch)
tree9bf1c002ec6f350d674b9b611e1d6887cc0f4098
parentef6034aaae28ce60ce9b17f36642597eaf8856f9 (diff)
fixed issues with Ctrl-a and Ctrl-v bindings working as expected
svn path=/trunk/externals/tkwidgets/; revision=9047
-rw-r--r--text.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/text.c b/text.c
index cf5f776..d460572 100644
--- a/text.c
+++ b/text.c
@@ -23,7 +23,6 @@
#include <string.h>
#include "shared/tkwidgets.h"
-/* TODO: get Ctrl-A working to select all */
/* TODO: set message doesnt work with a loadbang */
/* TODO: window name "handle1376fc00" already exists in parent */
/* TODO: figure out window vs. text width/height */
@@ -176,6 +175,18 @@ static void create_widget(t_textwidget *x)
/* bind to KeyRelease events to send out right outlet one key at a time */
sys_vgui("bind %s <KeyRelease> {+pd %s keyup %%N \\;} \n",
x->widget_id->s_name, x->receive_name->s_name);
+/* override the standard Pd bindings for these since they cause trouble */
+#ifdef __APPLE__
+ sys_vgui("bind %s <Mod1-a> {%s tag add sel 1.0 end} \n",
+ x->widget_id->s_name, x->widget_id->s_name);
+ sys_vgui("bind %s <Mod1-v> {tk_textPaste %s} \n",
+ x->widget_id->s_name, x->widget_id->s_name);
+#else
+ sys_vgui("bind %s <Control-a> {%s tag add sel 1.0 end} \n",
+ x->widget_id->s_name, x->widget_id->s_name);
+ sys_vgui("bind %s <Control-v> {tk_textPaste %s} \n",
+ x->widget_id->s_name, x->widget_id->s_name);
+#endif
}
static void drawme(t_textwidget *x, t_glist *glist)