Kent West wrote:
Hugo Vanwoerkom wrote:
Kent West wrote:
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).


IFAIK you've hit upon the one problem in cross-platform programming, access to the speaker for variable duration (dit and dah).

I would use Qt and that makes keypresses easy to detect, but not sound of variable duration, unless you don't mind recording a dit.wav and a dah.wav and then the problem is easy again.

Ah, this is the info I needed. Basically what I'm hearing is that it can't be done, easily, cross-platform, suitably for giving my fellow hams a taste of programming.


Right. Even using pre-recorded .wav files my experience is that those take too much time to start playing so it would defeat the purpose of detecting key-presses.

I used to have the M$ pc-speaker code around and you could write Qt code that uses that if it finds itself on Windows. But in any case one would have to recompile the code on each OS platform.

Things change of course if the cross-platform requirement goes away.

Hugo


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to