# 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.<br># and I&#39;m attaching the abstracion I was using in Windows too. (keybin.pd, keybin-help.pd)<br>-ugur-<br><br><div><span class="gmail_quote">On 5/29/07, <b class="gmail_sendername">
Claude Heiland-Allen</b> &lt;<a href="mailto:claudiusmaximus@goto10.org">claudiusmaximus@goto10.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
ugur guney wrote:<br>&gt; # When I press and hold a key, after a short time [keyup] starts to output<br>&gt; the number of that key repeatedly (before releasing it). In Windows it only<br>&gt; outputs the key no when a key is released. 
</blockquote><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It&#39;s just the way X11 works, as far as I understand it.&nbsp;&nbsp;I did a test<br>
with GridFlow, and the same thing happens (console log from attached patch):<br><br>Here the first number is the elapsed time since the previous event<br>(measured in Pd logical time).&nbsp;&nbsp;It would be possible to patch up<br>
something that would discard any &quot;keyrelease immediately-followed-by<br>keypress for the same key&quot; pairs that occur with an elapsed time of 0<br>(hint: it would use [delay 0.1] or so, maybe even [delay 0] would work).
<br>&nbsp;&nbsp;The last keyrelease would be delayed a little, but it would either be<br>unnoticeable with [delay 0.1] or at exactly the same logical time with<br>[delay 0]<br><br></blockquote></div>