Good morning!
For a simple project, I’m using Slick and LWJGL for graphics in a StateBasedGame. In this project, receiving user input via the Slick GameContainer canvas (the GUI) is required to parse input commands. I went ahead and implemented Slick’s TextField class and encountered some weird behavior with regards to the provided cursor (the underscore character) present in all TextFields.
Whenever I type basically any character into the TextField, I get expected results (you know, the characters fill the TextField :point:) EXCEPT if I press spacebar. If I press spacebar (you know… to add a whitespace to my TextField), the TextField cursor flies to the LEFT instead of to the RIGHT. The TextField fixes itself when you type another character though, which is weird.
Steps to reproduce this to see what I’m talking about:
- Create a TextField from the Slick library
- Ensure that textField.setCursorVisible(true);
- Type ‘hello world’ and observe the weird behavior when entering the whitespace between the ‘hello’ and ‘world’
This is really counter-intuitive and inconvenient for anyone who feels like typing sentences in my application ;D
Here’s a copy of the src (http://pastebin.com/P6GztgxP) of TextField I’m using, which is straight from http://slick.ninjacave.com/
Thank you