Can someone explain this or confirm it as a bug?
If I set my English Windows XP system (with English keyboard) to the following
settings (via Start>Control Panel>Regional and Language
Settings>Languages>Details):
Input Language: German
Keyboard Layout: German
and then open the On-Screen Keyboard
(Start>Programs>Accessories>Accessibility>On-Screen Keyboard) it shows the
German keyboard map. I can click on the little keys/buttons and type things in
German in Notepad. Everything looks ok to me..
Then.... I go here: http://oddhammer.com/tutorials/german.html
I can type things in the input box and the German characters show up fine. All
of the characters including ? can be typed and show up correctly.
BUT String.fromCharCode(Key.getAscii()) does not accurately duplicate the last
character typed. It acts as though the shift key was never pressed. So I
can’t seem to use getCode() or getAscii() to programmatically detect the “?”
character if my input and keyboard are set to German even though it’s showing
up correctly in the input box when I type it.
And.. naturally when my Input Language and Keyboard Layout are set back to
English it all works just fine..
I can’t imagine that this is a bug in the Flash Player.. otherwise somebody would have found it long ago. ?
27 Jan 2005 at 02:59 am | #
Sadly but true, thats why its virtually not possible to create an international onscreen keyboard using flash.
27 Jan 2005 at 05:04 am | #
just a try...
in the Regional and Language
Settings go to advanced and try setting the language for non unicode program to german.
this has saved me with copy and paste problem many times
27 Jan 2005 at 05:26 am | #
MK - thanks for the suggestion.. I tried and it didn't help.
27 Jan 2005 at 12:19 pm | #
Can someone with a German O/S and German keyboard try the test and see if they see the same results with a REAL keyboard. I'm curious if this is because I'm on an English O/S with an English keyboard trying to emulate another language.
And.. if you have a different setup (French, Spanish, Portuguese, etc) please try it and report what you find.
To test:
- open http://oddhammer.com/tutorials/german.html
- type a ? character into the "input box"
- see what shows up in the String.fromCharCode() box
28 Jan 2005 at 07:08 am | #
getCode returns 219
getAscii returns 223
StringFromCharcode returns ?ü (ß)
It looks like you will have to check the status of the SHIFT key (keycode 16) manually and then use a lookup table to get the correct chars.
28 Jan 2005 at 11:19 am | #
(Mario was using a German keyboard and German O/S)
Here's why I'm seeing this as a bug..
when I use String.fromCharCode(Key.getAscii()) with English keyboard/OS it correctly returns ? rather than the / character....
but with the German keyboard/OS the shift is ignored and I get ?ü instead of ?
Basically it looks like with the English keyboard the shift key is recognized by Key.getAscii() and so the "shifted" key value is returned.. but with German the shift key is ignored and the key value that is returned is for the unshifted ?ü key....
25 Feb 2005 at 10:32 am | #
ok, we found a workaround for this..
basically we put a hidden text field off stage, and keep focus on it. Each time a key is pressed we grab the character from that text field and add it to the "real" text field and find which character was used. What a hack... sigh.
25 Feb 2005 at 11:50 am | #
i reported that very issue a long time ago, when i tried to do a c64 emulator in fp6. highly annoying bug, only workaroundable with ugly hacks :(
04 Apr 2006 at 08:14 pm | #
It is possible to make a Flash-Keyboard, but you must become now with the Computer, Zen you will have the gift, and the scan codes will flow.
My fellow Indian Guru Programmers are the best in this Dimension, as they have achieved the necessary nirvana and seen the Virtual Flash Keyboard in their vision, so that you Westerners may see it here: [@ no cost of Rupees to you]
http://www.sweden4rus.nu/rus/info/klava/editor.asp
http://www.sweden4rus.nu/program/klava.swf
Das Downloaden: http://www.sweden4rus.nu/program/klava.zip
Do not listen to "bokel"
>bokel says: 27 Jan 2005 at 02:59 am | #
>Sadly but true, that?¢‚Ǩ‚Ñ¢s why its virtually not possible to create an >international onscreen keyboard using flash.
He is not One with the Computer, he will fail miserably and the Gurus will now take away his job, his destiny has been "Out-Sourced".
Gandhi has spoken,
It is now written.
05 Jan 2007 at 07:36 am | #
Well I would say nothing is impossible.
It is a work in progress as I still have to make numeric pad
and arrow keys but this http://www.artgroup.nl/keyboard one does a bit more than
just one letter.
Greetz,
Niels
13 Jan 2007 at 06:58 pm | #
I have the same problem with a swiss keyboard.
I cannot get the characters with the key class, that I get with input field.
I will try the hidden input field hack, but it is still not nice.
Regards
Zsolt