Kent West(westk@acu.edu) is reported to have said:
All I want to do is to detect two keys, say the left- and right-shift
keys, or the < and > keys. For one key, a short "dit" audio tone
would be generated, and for the other key, a longer "dah" audio tone
would be generated. I need to bypass the keyboard buffer, so that
holding down the dit key for two seconds doesn't generate 30 dits; it
should produce dits while the key is held down, but once the key is
let up, the dits should immediately stop (after finishing the one
it's on).
Found kbhit(), found beep. But it's not trivial to press '<' and have
the sound quit when you stop pressing: it keeps beeping until the
keyboard buffer is empty I guess. Do beeping in the background?
Code thusfar:
http://www.esnips.com/doc/2314e21f-19b9-4063-8874-72ac36480e00/do_dit_dah