ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a java applet that should read the keys the users presses in a website. I watch it in firefox on linux. It successfully ready all normal key and shows theirs ASCII vaule. But it can't dsiplay the special key like the "öäüöèéà" characters used in Europe and elsewhere (ISO-8859-1).
Here is the relevant code:
public boolean keyDown(Event event, int j)
keyPressed = (char)j;
Like this it assigns all keys except the special "umlaute" chars to the keyPressed variable.
But it seems that the special keys (öäüèé) don't activate this handler, because I watch the normal key's ASCII values, but nothing happens with the special key. So I guess they don't activate the keyDown... Is there an other method?
When you run the code, you don't need the .class part
I took a look at the key_event class and it seems the only support for european characters/accents is the Spanish inverted exclamation mark and accents used with dead keys. So if you are looking to listen for special characters ie 'ñ' you'll have to write those characters yourself (unless someone else has already done that). Anyway check this code out which shows how to detect use of dead keys
I don't think my knowledge of java is good enough to write a key listener that accepts the accent keys!
From what I red on the web I got the impression that this might even be an impossible problem... Could it be that Sun just didn't implement support for European accent keys in their jre port to linux? Because if it's possible to create such a keylistener for the accent keys I find it strange that I can't find any traces of code that does such thing. I only found key-listeners posted in discussions about special keys (not neccessarily European accents) and all of them don't recognite the accent keys, they react to it but just report a symbol like this .
Does anyone know if this is possible to do and how or if it's not?
But I tried these two ways and both of them failed!
LC_ALL=ch_DE firefox &
also tried it with LANG=ch_DE and with LC_ALL=ch_DE.UTF8 and the same for LANG.
But none of that works on gentoo or fedora code 3, you can't enter a accented key.
The strange thing I figured out today is, that it works on my SuSe9 PC at work! How can this be? I think saw something in env containing UTF, but now when I login by ssh I don't see anything that could be usefull anymore...
Do you have any idea what changes in env or configuration could result in this difference between the behaviour of SuSe and FC3/gentoo?
On the system that works, I use
And on the system where it doesn't work this one:
But it's both the Sun version, which should work...