>Hi All.
>As a leisure time project my son and i would like to develope a small application which would help us learn to Morse code (we are talking radio here).
>I am looking for a function to start/end the beep. The one that i know takes duration and frequency as parameters. In this case i don't know the duration. I want to press a key - start beeping, release a key - end beeping.
>Another accompanying question: There are MouseDown/Up events on a form but no KeyDown/Up. Is it possible in VFP7 to intersept KeyDown/Up events.
>
>Best wishes.
>Kamil
Kamil,
1) I would put the beep function in a DO WHILE...ENDDO loop and the condition would be while a key was being pressed. i.e.:
FUNCTION BeepSound
Parameter nKeyCode
DO WHILE INKEY() = nKeyCode
?? CHR(7)
ENDDO
ENDFUNC
2) For the second part of your question look at the forms KEYPRESS event. It gets a parameter, nKeyCode, and in this event you could call your beep function with the nKeyCode value. Then loop for as long the key continues to be pressed.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.