Hi Julien,
No, this is not the case. KBHits are only key down events. I tried
to include several kb => now, but it didn't help.
See also this example here:
http://chuck.cs.princeton.edu/doc/examples/event/kb2.ck
Apparently, the solution is emptying the event queue by calling
kb.getchar() until kb.more() returns false:
KBHit kb;
me.sourceDir() + "/bum.wav" => string filename;
adc => WvOut b => blackhole;
filename => b.wavFilename;
kb => now;
while(kb.more()) kb.getchar();
b.closeFile();
SndBuf buf => dac;
filename => buf.read;
kb => now;
The important line is "while(kb.more()) kb.getchar();",
apparently. So I guess kb => now; doesn't wait at all if there
are still unprocessed keys in the queue.
Best, Manuel
Am 05/12/13 12:18, schrieb Julien Saint-Martin: