Java: Missing key codes on non-US keyboards

Java does not seem to have key codes for several keys on non-US keyboards. This does not prevent the typed characters from being recognized, but it makes it impossible for the Robot class to simulate pressing these keys.

Examples of missing key codes

On a standard French AZERTY keyboard, 2 keys result in a key code of 0 (unknown key code): The key above the tab which generates the character “²” and the much more important ù% key.

On a German QWERTY keyboard, the ß?\ key and the äÄ,öÖ and üÜ keys are undefined.

You can confirm this using the Java KeyEventDemo:
Percentage key on AZERTY keyboard

Workaround

Use the Alt Numpad input method.

 

How to add a URL to the Java Exception Site List file

On one of our computers, the Security Tab in the Java Control Panel sometimes looks like this:
Java Control PanelAs you can see, the part required to manage the exception site list is missing/not accessible. I have no idea why (reinstalling Java did not help).

However, you can also add exceptions by directly editing the exception.sites file. Under Win 7, it is normally found in the C:\Users\*YOUR USERNAME*\AppData\LocalLow\Sun\Java\Deployment\security directory. Simply add a new line for each URL (e.g. https://stupdidbank.example.com), save the file, then restart the browser.

See this page or the official Java documentation for further information.