One workaround (that I'm using in practice since long) is to hold back the keyup message for slightly longer than the repeat time, and only let it through when keydown didn't come again in the meantime. The method introduces latency on keyup but not on keydown. See attached patch, it is slightly too complicated for ASCII illustration.
Katja On 3/18/19, Peter P. <[email protected]> wrote: > Hi list, > > chiming in to the discussion of possible improvements regarding mice and > now also keyboards, I am wondering if there could be a way within Pd to get > keyboard events without having the operating systems (all three of them) > repeat key down/up events in rapid succession. > > I know that I can tell the operating systems to disable it but would > absolutely prefer Pd's keyboard objects to get these without repeats. > > Happy to hear any feedback on that! > P > > > > _______________________________________________ > [email protected] mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list >
#N canvas 360 291 455 410 10; #X obj 34 7 key; #X obj 88 7 keyup; #X obj 99 260 print; #X obj 34 103 moses 1; #X msg 73 128 clear; #X obj 99 216 change; #X obj 108 239 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 34 191 pipe 45; #X obj 88 39 sel 32; #X msg 88 68 0; #X obj 34 39 sel 32; #X msg 34 67 1; #X text 137 39 test with space key; #X floatatom 73 167 5 0 0 0 - - -; #X text 26 294 Anti-repeat trick: the 0 message is held back for 45 ms and when a 1 message is received in the meantime \, the 0 message is cleared from the pipe object. Note that this causes 45 ms added latency in the keyup message \, but not in the keydown message. Delay time may be set shorter \, depending on system settings.; #X text 28 374 Katja Vetter March 2019; #X connect 0 0 10 0; #X connect 1 0 8 0; #X connect 3 0 7 0; #X connect 3 1 4 0; #X connect 3 1 5 0; #X connect 4 0 7 0; #X connect 5 0 2 0; #X connect 5 0 6 0; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 9 0 3 0; #X connect 10 0 11 0; #X connect 11 0 3 0; #X connect 13 0 7 1;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
