[Nifty Gui textfield]Unable to enter characters that require you to press ALT GR

Hi,

When I try to imput a character by using ALT GR (e.g. @, #, ^, €,…) in a nifty gui textfield, it just reacts like no key was pressed.
Is there a way to eneble it? Or does nifty gui simply not support the ALT GR key?

many thanks in advance.

It doesn’t support it. It doesn’t exist on Mac either so you should think about using it in an application anyway. Btw all the ones you posted are available without AltGr codes on my keyboard…

Edit: Duh, I guess you mean as a modifier key? Thats kind of strange though.

Likely the BitmapFont doesn’t contain the characters/page/etc…

@T0neg0d: I’m using the default font. Is that the “Aurulent-sans-16” font in the nifty-style-black jar? Because it does contain those characters.

@Normen: Yes. I’m using a belgian keyboard, with a layout like this: (it isn’t the most common kind, I know)

If I want to get the hashtag on my keyboard, I need to hold the ALT GR key (right of the space bar), then press the 3 key. And somehow, nifty Gui doesn’t seem to support this. Also not with letter keys, like ALT GR + E, which should give the euro symbol (€).

You could try adding a RawInputListener to InputManager and see what key event comes through when you type those characters… and see what the key char is. Perhaps it is actually something lower level with the issue.

@beniboy said: @T0neg0d: I'm using the default font. Is that the "Aurulent-sans-16" font in the nifty-style-black jar? Because it does contain those characters.

@Normen: Yes. I’m using a belgian keyboard, with a layout like this: (it isn’t the most common kind, I know)

If I want to get the hashtag on my keyboard, I need to hold the ALT GR key (right of the space bar), then press the 3 key. And somehow, nifty Gui doesn’t seem to support this. Also not with letter keys, like ALT GR + E, which should give the euro symbol (€).

Sorry for harping on the issue, but have you verified that the font was actually exported with those character sets? You have actually looked through the images and verified this? You don’t have to export a Bitmap Font with all characters… maybe it wasn’t? /shrug

@t0neg0d: I have looked at the exported image, not at the font itself. I’m not 100% sure if I picked the correct font though, but I use the default nifty Gui font.

@pspeed: I’ve tried it, and this it the output I got when attempting to type the @ character: (Alt Gr+the 2/é/@ key)

Key(CODE=29, PRESSED)
Key(CODE=184, PRESSED)
Key(CODE=3, CHAR=@, PRESSED)
Key(CODE=3, RELEASED)
Key(CODE=29, RELEASED)
Key(CODE=184, RELEASED)

It seems to somehow detect three keys while I only used two.

@beniboy said: @t0neg0d: I have looked at the exported image, not at the font itself. I'm not 100% sure if I picked the correct font though, but I use the default nifty Gui font.

@pspeed: I’ve tried it, and this it the output I got when attempting to type the @ character: (Alt Gr+the 2/é/@ key)

Key(CODE=29, PRESSED)
Key(CODE=184, PRESSED)
Key(CODE=3, CHAR=@, PRESSED)
Key(CODE=3, RELEASED)
Key(CODE=29, RELEASED)
Key(CODE=184, RELEASED)

It seems to somehow detect three keys while I only used two.

Well, you pressed the Alt Gr and then the 2 and then the keyboard drivers or whatever sent the @. Makes sense to me.

So it looks like JInput is sending along the right values at least and I’m pretty sure JME passes these off directly to Nifty.