[PD] how to emulate mouse left-click to canvas?

Roman Haefeli reduzent at gmail.com
Sat Jul 29 01:04:56 CEST 2017


On Fre, 2017-07-28 at 19:46 +0200, Dan Wilcox wrote:
> Looking in g_canvas.c, canvas can take a "click" message followed by
> 5 floats. The arguments are "t_floatarg xpos, t_floatarg ypos,
> t_floatarg shift, t_floatarg ctrl, t_floatarg alt" but it none of
> those are used, at least by the following function:
> 
> static void canvas_click(t_canvas *x,
>     t_floatarg xpos, t_floatarg ypos,
>         t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
> {
>     canvas_vis(x, 1);
> }
> 
> It seems to only make the canvas visible, so try sending "click 0 0 0
> 0 0" to a named canvas...

Yeah,  I couldn't figure out what this function is useful for and
stopped digging further. But reading it made me confident that 'click'
might doesn't do what I want. In the meantime, Ingo mentioned 'mouse'.
I guess the corresponding code is found in g_editor.c:

void canvas_mouse(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
    t_floatarg which, t_floatarg mod)
{
    canvas_doclick(x, xpos, ypos, which, mod, 1);
}


Roman


> > On Jul 28, 2017, at 6:32 PM, pd-list-request at lists.iem.at wrote:
> > 
> > From: Roman Haefeli <reduzent at gmail.com>
> > Subject: [PD] how to emulate mouse left-click to canvas?
> > Date: July 28, 2017 at 4:55:26 PM GMT+2
> > To: Pd-List <pd-list at lists.iem.at>
> > 
> > 
> > Hey all
> > 
> > Is it still possible in Pd to send a message to canvas in order to
> > emulate a mouse click? Some documents[1] and patches[2] on the Pure
> > Data wiki suggest it was possible with earlier versions of Pd, but
> > I
> > can't get the examples to work with current Pd. 
> > 
> > My aim is to make a symbolatom ready for text input without
> > clicking it
> > first. 
> > 
> > Roman
> --------
> Dan Wilcox
> @danomatika
> danomatika.com
> robotcowboy.com
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170729/95564b4a/attachment.sig>


More information about the Pd-list mailing list