From 4d9785c238d848c9e73c00dc90f925c79251a88c Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 26 Nov 2007 23:38:41 +0000 Subject: fixed issues with Ctrl-a and Ctrl-v bindings working as expected svn path=/trunk/externals/tkwidgets/; revision=9047 --- text.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/text.c b/text.c index cf5f776..d460572 100644 --- a/text.c +++ b/text.c @@ -23,7 +23,6 @@ #include #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 {+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 {%s tag add sel 1.0 end} \n", + x->widget_id->s_name, x->widget_id->s_name); + sys_vgui("bind %s {tk_textPaste %s} \n", + x->widget_id->s_name, x->widget_id->s_name); +#else + sys_vgui("bind %s {%s tag add sel 1.0 end} \n", + x->widget_id->s_name, x->widget_id->s_name); + sys_vgui("bind %s {tk_textPaste %s} \n", + x->widget_id->s_name, x->widget_id->s_name); +#endif } static void drawme(t_textwidget *x, t_glist *glist) -- cgit v1.2.1