[PD] Behavoir of [keyup] in Linux

ugur guney ugurguney at gmail.com
Tue May 29 13:27:33 CEST 2007


# Adding a delay worked well. But something is surprising. The [delay] have
to be longer than 0.1 to block this oscillating behavior. I'm attaching a
patch (delaykey.pd) which shows the implementation. I think X11 gives the
"key pressed" message in every 40 msec's or something. So 0.1 delay is not
enough to block these messages.
# and I'm attaching the abstracion I was using in Windows too. (keybin.pd,
keybin-help.pd)
-ugur-

On 5/29/07, Claude Heiland-Allen <claudiusmaximus at goto10.org> wrote:
>
> ugur guney wrote:
> > # When I press and hold a key, after a short time [keyup] starts to
> output
> > the number of that key repeatedly (before releasing it). In Windows it
> only
> > outputs the key no when a key is released.


It's just the way X11 works, as far as I understand it.  I did a test
> with GridFlow, and the same thing happens (console log from attached
> patch):
>
> Here the first number is the elapsed time since the previous event
> (measured in Pd logical time).  It would be possible to patch up
> something that would discard any "keyrelease immediately-followed-by
> keypress for the same key" pairs that occur with an elapsed time of 0
> (hint: it would use [delay 0.1] or so, maybe even [delay 0] would work).
>   The last keyrelease would be delayed a little, but it would either be
> unnoticeable with [delay 0.1] or at exactly the same logical time with
> [delay 0]
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070529/db171ff5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delaykey.pd
Type: application/octet-stream
Size: 724 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070529/db171ff5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keybin.pd
Type: application/octet-stream
Size: 4278 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070529/db171ff5/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keybin-help.pd
Type: application/octet-stream
Size: 599 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070529/db171ff5/attachment-0002.obj>


More information about the Pd-list mailing list