Accueil > Recuperation des codes touches Avec Eanim version 7_6c |
version v1 |
11/02/2007 |
Test touches avec Version V7005d |
|
|
Appuyer sur le bouton pour demarrer la
fonction. Appuyer sur une touche pour afficher l'etat: -touche appuyee ou relachee -code de la touche -code ascii de la touche |
fichier phi Appel Fonction: (sur clic souris)
|
fichier touche.as class touche{ static function funcTest(){ } // fin fonction /*==========Fonction Touche========== */ static function funcTouche(){ var keyListener:Object = new Object(); /*---------- Fonction KeyDown----------*/ keyListener.onKeyDown = function(){ _root.tetat=true;/* Etat de la touche*/ _root.tcode_text=Key.getCode(); _root.tascii_text=Key.getAscii(); }; /*---Fin fonction KeyDown - ';' obligatoire---*/ /*---------- Fonction KeyUp----------*/ keyListener.onKeyUp = function(){ _root.tetat=false;/* Etat de la touche*/ _root.tcode_text=Key.getCode(); _root.tascii_text=Key.getAscii(); }; /*---Fin fonction KeyUp - ';' obligatoire---*/ Key.addListener(keyListener); /* recup val*/ } /*==========Fin Fonction Touche==========*/ } // fin class |