[PD] In 2019 is there a way to detect mouse down/up?

Jean-Yves Gratius jyg at gumo.fr
Fri Mar 15 10:37:58 CET 2019


Not sure it can be considered as a vanilla solution, but you should edit 
tcl/pdtk_canvas.tcl file and add one line in the proc 
pdtk_canvas_mouseup (line 216) :

proc pdtk_canvas_mouseup {tkcanvas x y b} {
     set mytoplevel [winfo toplevel $tkcanvas]
     pdsend "$mytoplevel mouseup [$tkcanvas canvasx $x] [$tkcanvas 
canvasy $y] $b"
     pdsend "MOUSE mouseup [$tkcanvas canvasx $x] [$tkcanvas canvasy $y] $b"
}
(see attachment)

Then you'll always need to have a receiver (named "MOUSE") in your 
patch, else you will receive error messages in pd console.
If you click on a bang object in your patch, you can then listen to the 
MOUSE receiver and wait for the message "mouseup"

On 14/03/2019 13:32, Fede Camara Halac wrote:
> Not the best solution, but you may be able to monitor a slider for value changes to emulate a click-down, click-up situation... so you'd be tricking a click-drag :)
>
>
> fdch.github.io
>
>> On Mar 14, 2019, at 11:02 AM, IOhannes m zmoelnig <zmoelnig at iem.at> wrote:
>>
>>> On 14.03.19 10:42, Chris McCormick wrote:
>>>
>>>> keep in mind that it is not touch sensitive.
>>> What do you mean by this? It only responds to mouse events and not touch
>>> events?
>> no. that's not what i meant.
>>
>> it was a(n admittedly stupid) joke on the discrepancy between a
>> mouse-based interface (where you only get a boolean value of whether a
>> button is clicked or not) and the expectation of a (musical) "hardware
>> keyboard" that typically gives you "touch sensitive" data in the form of
>> 'velocity'.
>>
>> fgamsdr
>> IOhannes
>>
>>
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
>
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdtk_canvas.tcl
Type: text/x-tcl
Size: 16526 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190315/35cd8b33/attachment.tcl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testing_tcl_mouseup.pd
Type: application/x-wine-extension-pd
Size: 559 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190315/35cd8b33/attachment.bin>


More information about the Pd-list mailing list