Inkey()
Syntaxe
Caractere$ = Inkey()Description
Renvoi un 'Caractere$' si une touche est appuyée lors de l'appel de Inkey(). Cette commande ne bloque pas l'exécution du programme. Si des touches spéciales (non-ascii) doivent être gérées, RawKey() peut être appelé après Inkey().
Exemple
If OpenConsole()
PrintN("Appuyez sur [Echap] pour quitter")
Repeat
KeyPressed$ = Inkey()
If KeyPressed$ <> ""
PrintN("Vous avez appuye sur : " + KeyPressed$)
PrintN("Son identifiant numerique est : "+Str(RawKey()))
ElseIf RawKey()
PrintN("Vous avez appuye sur une touche qui n'est pas alpha-numerique.")
PrintN("Son identifiant numerique est : "+Str(RawKey()))
Else
Delay(20) ; Evite de monopoliser tout le temps processeur. Utile pour un OS multi-tâches.
EndIf
Until KeyPressed$ = Chr(27) ; Attends jusqu'à ce que la touche [Echap] soit appuyée
EndIf
Remarks
The ASCII codes and numeric values reported in this description may change depending on the code page you have configured at boot time for keyboard input. However, the concepts should be the same and you can use the above example to figure out the real values for your system.
Un tableau contenant les valeurs ascii est disponible ici.
See Also
RawKey(), Input()
OS Supportés
Tous