The Windows/Apple logo thing is a little like the market for Coke/Pepsi products. There have been exceptions in the past and still may be in the future. Even if today’s keyboard manufacturers are in that type of market, there is no guarantee that future devices will be “backwards compatible” or cross compatible with rare keyboard-like peripherals. I’ve heard Linux users refer to the same key as the “Super” or “Meta” key and perhaps one other name I can’t recall at the moment. Imagine a user accustomed to the term Super key running a Linux operating system on a Macbook laptop being told to press the Windows key.
I was actually going to make some wiki-like edits to your example, but decided on something more general because there are so many standards to choose from when it comes to localization. A list of simple caveats shouldn’t be unwelcome.
What did you mean then? The JavaDoc makes a distinction between key codes (which are relevant to KEY_PRESSED or KEY_RELEASED events) and key chars (which are relevant only to KEY_TYPED events.) Part of the class descriptions even mentions such a scenario for Windows platforms.
[quote]“Key typed” events are higher-level and generally do not depend on the platform or keyboard layout. They are generated when a Unicode character is entered, and are the preferred way to find out about character input. In the simplest case, a key typed event is produced by a single key press (e.g., ‘a’). Often, however, characters are produced by series of key presses (e.g., ‘shift’ + ‘a’), and the mapping from key pressed events to key typed events may be many-to-one or many-to-many. Key releases are not usually necessary to generate a key typed event, but there are some cases where the key typed event is not generated until a key is released (e.g., entering ASCII sequences via the Alt-Numpad method in Windows). No key typed events are generated for keys that don’t generate Unicode characters (e.g., action keys, modifier keys, etc.).
[/quote]