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

Hans-Christoph Steiner hans at at.or.at
Mon Sep 26 17:20:13 CEST 2011


On Sep 25, 2011, at 12:29 PM, Marvin Humphrey wrote:

> 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)


Hey Marvin,

Welcome to Pd!  This is a nice entry, showing up with a patch to fix a  
bug :-D.  The whole canvas_key thing is pretty messy, so I think your  
patch is probably as good as its going to get.  I'll apply it.   
Patches are definitely very welcome :-D.  In the future, please submit  
them to the patch tracker, the 'git format-patch' format is preferred:

http://puredata.info/dev/patchtracker

.hc


----------------------------------------------------------------------------

Terrorism is not an enemy.  It cannot be defeated.  It's a tactic.   
It's about as sensible to say we declare war on night attacks and  
expect we're going to win that war.  We're not going to win the war on  
terrorism.        - retired U.S. Army general, William Odom





More information about the Pd-list mailing list