If (Key.getCode() == 232)

hi,
why this code don’t work?
How to procede with accentued key?
thanks

Code:
monEcouteur = new Object();
monEcouteur.onKeyDown = function() {
if (Key.getCode() == 232) {
trace(“Vous avez appuyé sur è.”);
}
};
Key.addListener(monEcouteur);

Key.ASCII maybe?

shouldn’t be

monEcouteur = new Object();
monEcouteur.onKeyDown = function() {
if ( Key.isDown(232) ) trace( “Vous avez appuyé sur è.”);
}
Key.addListener(monEcouteur);

another frog YIHA!

bien lbonjour de la france !

salut mlkdesign:)
>ahmed > have you test???
it doesn’t work:)
>grandsp5 > KEY.ASCII >no
the problem : accentued letters
thanks:)

the thing is, is the keycode the same for english and french keyboard ? (I the the ‘é’ is the number ‘8’ on a qwerty keyboard - I should check though…

if your not sure which keycode it is; try something like that:
new function on the _root level:


testnumber = 100
function bob(testnumber) {
if ( Key.isDown(testnumber) ) 
trace( "Vous avez appuyé sur è. Numéro de la touche: "+testnumber);
}

and on your button:


on(release){
testnumber+=1
_root.bob(testnumber)
}

sort of a debugging script - you’d have to go through 200 keycodes… though it might work. Dunno, ask kax or ahmed.

232 is the good code for the letter “é” on french keyboard
but the problem is accentued letters like à, è, é, ù, etc…
:slight_smile: :sigh:

i don’t get it… what’s the PROBLEM ?

it won’t showup in flash ??? then use: System.UseCodePage=true;

monEcouteur = new Object();
monEcouteur.onKeyDown = function() {
if (Key.getCode() == 232) {
trace("Vous avez appuyé sur è.");
}
};
Key.addListener(monEcouteur);

have you test ?
and System.UseCodePage=true; and Unicode UTF8 aren’t the solution !
The question :
Is it possible to do action with key (accentued letter) ?

:slight_smile: