[PD] Keyboard shortcuts for "nudge", "done editing"

Marvin Humphrey marvin at rectangular.com
Sun Sep 25 18:29:46 CEST 2011


On Sun, Sep 25, 2011 at 07:11:32AM -0700, Marvin Humphrey wrote:
> On Sun, Sep 25, 2011 at 05:16:23PM +1000, Richie Cyngler wrote:
> > If you drag select an object or group of objects you can use the "nudge"
> > functionality with cursor keys, you can also hold shift for block moves. So
> > that functionality is already there.
> 
> Thanks, Richie.  It seems that there is a bug affecting Pd on Mac OS X (at
> least 10.6), and the cursor keys do not function properly.
> 
>     http://sourceforge.net/tracker/index.php?func=detail&aid=3187517&group_id=55736&atid=478070

The patch below fixes the problem.  I don't know if it's the right solution,
though.

Assuming that cursor keys worked at one time on OS X in Pd... it seems that the
keycode sent when a cursor key is pressed may have changed in Snow Leopard.  I
haven't been able to track down any official documentation, though, nor any
other bug reports that describe the root of the problem.

Marvin Humphrey

diff --git a/src/g_editor.c b/src/g_editor.c
index f494732..76586fa 100644
--- a/src/g_editor.c
+++ b/src/g_editor.c
@@ -1700,13 +1700,13 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
         keynamesym = gensym("#keyname");
     }
 #ifdef __APPLE__
-        if (keynum == 30)
+        if (keynum == 30 || keynum == 63232)
             keynum = 0, gotkeysym = gensym("Up");
-        else if (keynum == 31)
+        else if (keynum == 31 || keynum == 63233)
             keynum = 0, gotkeysym = gensym("Down");
-        else if (keynum == 28)
+        else if (keynum == 28 || keynum == 63234)
             keynum = 0, gotkeysym = gensym("Left");
-        else if (keynum == 29)
+        else if (keynum == 29 || keynum == 63235)
             keynum = 0, gotkeysym = gensym("Right");
 #endif
     if (keynumsym->s_thing && down)






More information about the Pd-list mailing list