Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arbitrary start/end beep
Message
 
 
À
18/04/2003 06:58:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00779104
Message ID:
00779701
Vues:
16
>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 && Loop while the required key is being pressed
>    ?? CHR(7)  && Beep
>  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.


Hi, Jos.
I am afraid both of the approaches have flaws.
1) Chr(7) can produce different sounds on different PCs. On my PC it gives away a ding not exactly a beep.
2) Keypress rate on different PCs is different, so interscepting Keypress event will not work.
Best wishes.
Kamil
A moment of silence is our cosmic reset button.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform