<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Something like key &amp; keyup for virtual button]]></title><description><![CDATA[<p>Hi there! I just started to learn Pure Data. Does anyone know how to realize the function of key and keyup but for a virtual button like at the picture (e.g. bng)?  Here the signal goes while the mechanical button is helding, but I would like to know how to do it with the virtual one. Thanks a lot in advance!<img src="/uploads/files/1554570309550-for-forum.jpg" alt="for forum.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 09:15:22 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/11993.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Apr 2019 17:05:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Something like key &amp; keyup for virtual button on Sat, 06 Apr 2019 17:05:17 GMT]]></title><description><![CDATA[<p>Hi there! I just started to learn Pure Data. Does anyone know how to realize the function of key and keyup but for a virtual button like at the picture (e.g. bng)?  Here the signal goes while the mechanical button is helding, but I would like to know how to do it with the virtual one. Thanks a lot in advance!<img src="/uploads/files/1554570309550-for-forum.jpg" alt="for forum.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button</guid><dc:creator><![CDATA[ActPk]]></dc:creator><pubDate>Sat, 06 Apr 2019 17:05:17 GMT</pubDate></item><item><title><![CDATA[Reply to Something like key &amp; keyup for virtual button on Sat, 06 Apr 2019 17:31:15 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/actpk">@ActPk</a> The difficulty is that if a key is pressed, the OS will send several keyup and keydown events. This is the reason for that if you press and hold a key in a text editor, it will print the symbol of that key multible times, like: ffffffffffffffffffffffffffffffffffffffffffffff.</p>
<p>So in this example, the keydown event will immediately send a one, but if the [keyname] object sends a zero, it will start a delay of 50 milliseconds. If within this time another one is sent out, the delay will be stopped. Only if no other one is sent, the delay will finish and send a zero.</p>
<p>So this works, but the keyup event will have a delay of 50 milliseconds. I am not sure if this can be prevented as the behavior is due to the OS. It may be neccessary to use another delay time on your OS to make it work.</p>
<p><a href="/uploads/files/1554571861848-keydownup.pd">keydownup.pd</a></p>
<p><img src="/uploads/files/1554571872472-bildschirmfoto-vom-2019-04-06-19-24-38.png" alt="Bildschirmfoto vom 2019-04-06 19-24-38.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/2</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Sat, 06 Apr 2019 17:31:15 GMT</pubDate></item><item><title><![CDATA[Reply to Something like key &amp; keyup for virtual button on Sat, 06 Apr 2019 18:12:55 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/actpk">@ActPk</a> So my answer was for a real button, not for a virtual one... <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/wink.png" title=";)" alt=";)" /></p>
<p>For a virtual one you will need an extension like [mousestate], because in vanilla there is no way to detect a mouseup event. So you would have do use some object that detects mousedown and mouseup and check if the mouse is within given coordinates to simulate this kind of behavior. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/3</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Sat, 06 Apr 2019 18:12:55 GMT</pubDate></item><item><title><![CDATA[Reply to Something like key &amp; keyup for virtual button on Sat, 06 Apr 2019 18:20:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> The OP is looking to be able to click-hold (mouse) so that he can use that when running a patch in Android.<br />
I didn't know that when I posted the patch he has shown, and I can't think of a way to do that in Pd.<br />
It will be unpredictable too, when run in Android, even if there is a solution.<br />
So I imagine it needs to be Vanilla as well.<br />
I don't know of any way to do this with a mouse, as mouse events only work in editmode..<br />
I wonder if there is a special object for Android though in Droid Party or.....?<br />
David.<br />
P.S just seen your post......</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/4</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Sat, 06 Apr 2019 18:20:20 GMT</pubDate></item><item><title><![CDATA[Reply to Something like key &amp; keyup for virtual button on Sat, 06 Apr 2019 18:40:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> Here is an example using [receivecanvas]:</p>
<p><a href="/uploads/files/1554575959298-toggletest.pd">toggletest.pd</a></p>
<p><img src="/uploads/files/1554575946695-bildschirmfoto-vom-2019-04-06-20-38-26.png" alt="Bildschirmfoto vom 2019-04-06 20-38-26.png" class="img-responsive img-markdown" /></p>
<p>[receivecanvas] is from iemguts, i don't know if this works on Android and this was not mentioned in the OP <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/wink.png" title=";)" alt=";)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11993/something-like-key-keyup-for-virtual-button/5</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Sat, 06 Apr 2019 18:40:09 GMT</pubDate></item></channel></rss>