Ollhax's picture

KeyPress does not report backspace, return, etc.

Hey there, I just noticed that the KeyPress event does not return special characters (backspace, return, etc) any more (since the 1.1 update). It seems like this is by design, but isn't it easy enough for people to just filter out whatever they need instead?

I guess I could check for backspace, enter, etc from KeyDown functions but I'm not sure how well that would work with key repeats and so.

If the behavior is not to be reverted, how about a separate "RawKeyPress" that gives all the characters?

Thanks,
/Olle


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

RawKeyPress already exists: it is called KeyDown. Key repeat is enabled by default - you can disable it via the GameWindow.Keyboard.KeyRepeat property.

GameWindow.KeyPress is modeled after WinForms Control.KeyPress. There are technical reasons for this.

Refer to the keyboard documentation for more information. A more thorough explanation, with example code, also exists in issue #59.

Ollhax's picture

Alright, simple enough to change. Thank you.