Slick input field and special characters

Hi!

I’m using the awesome Slick-library for my game and wonders how I can add support for special characters such as “åäöÅÄÖ” in the TextField when typing input into it.

If I set the text in the textfield to Åäö with code it is shown, but if I type it in when it is focused it doesn’t show those letters, other regular letters works fine.

Thanks for the help!

Does your font support them? Unicode should.

When I write:

g.setFont(FONTS.size12);
g.drawString(“åäöÅÄÖ”, 100, 600);

I see the letters, but when I have a:
input_field = new TextField(app, FONTS.size12, X, Y, 100, 30);

and write into the field, it shows all letters except “åäö”.

I added a fix recently that should allow the input of letters outside of the “standard” ASCII range. It may need a bit more testing, so please pull the latest changes and let me know if it works.

For more robust GUI and text entry, I’d highly recommend using TWL instead of Slick’s built-in (and rather limited) UI.