I can’t use charCode, or keyCode in KeyboardEvent to find out the character pressed, because even if I change the keyboard layout, charCode and keyCode are not change (if press the same key).
So, how to find the presssed character, following to the current keyboard layout?
I already found this question, but what the document said:
The charCode property is the numeric
value of that key in the current
character set (the default character
set is UTF-8, which supports ASCII).
is not correct.
Edit: I am using Flex 4.
I found the solution.
We can listen for TextEvent. This event not only dispatches to text components, but also all focused components that implement UIComponent.
For example: