Keyboard I18N in keyboard setup

Started by Daniel_F, April 03, 2005, 15:31:00

Previous topic - Next topic

Daniel_F

The problem:
Create a "Keyboard setup" in a game where the player can set the keys.
For example the user clicks on "fire", a message tells to press a key you want to use as the fire button, the player presses any key, and the game prints the Internationalised key desctiption ("Left Shift","Home","á"...).

This is impossible now.

You may think it is not needed for a game, but it is in contrast with the "...commercial quality games to be written in Java." statement in the first page.

More details may be found here about my problem.(8th post)

Matzon

Why can't you use keycode/characters?

You ask and respond according to keycodes, and UI wise you use the characters ?

Daniel_F

Quote from: "Matzon"Why can't you use keycode/characters?

You ask and respond according to keycodes, and UI wise you use the characters ?

I assume you mean
"If the key does not have a character("up","home"...), than use the Keyboard.getKeyName() on the keycode, otherwise use the character."

1.
-This way the non-character keys are not internationalised, although looking at my keyboard i hope all of theese are always on the same place, so maybe it is not a problem.

-there are keys with characters, but are not really character (escape char code #27, tab #9, back #8, enter #13), but maybe there are not many of theese. (Is there a list somewhere?)

-Returned chars depend on modifiers, for example the caps lock. Ok ok, i may lowercase them. I hope noone will hold shift+press button "1" when setting a key. ;)


2.This is worst:
I started with creating a frame, where the user can set the screen size, fullscreen/findowed, and set the keys. And when he clicks button "play" the game starts (like some games have). I was "wow im ready and it is so cool", and then I realized I cannot use java VK_ java-keys in the LWJGL-keyboard.  :(

So either I put the key-selection inside the game (damn), or use the new AWTGLCanvas (damn). (BTW, the AWTGLCanvas and the Display.create are not consistent Keyboard-wise (KeyEvent, Keyboard).)

P.S.: Just looked at the UT2K4 key-setting, and it recognises the keys cool, even if I set the locale from hun to eng (shift+alt), the key-names appear with the eng-names. This is what I call professional.

P.S.2: I would like to say that the I like LWJGL 99.5%, it is just the Keyboard-handling that is driving me nuts.
I think Ill choose the keycode/char combo path you suggested.