Unprintable ascii text (numbers 0-31 and 127 in decimal) is no longer sent to the unicode argument of love.keypressed

This commit is contained in:
Alex Szpakowski
2013-07-24 02:44:36 -03:00
parent 8408c276cb
commit 295487165f
+2 -1
View File
@@ -103,7 +103,8 @@ Message *Event::convert(SDL_Event &e)
txt = "unknown";
arg1 = new Variant(txt, strlen(txt));
txt = convertUnicode(e.key.keysym.unicode);
if (txt)
// We don't want to send unprintable unicode text.
if (txt && (txt[0] >= ' ' && txt[0] != 127))
{
arg2 = new Variant(txt, strlen(txt));
msg = new Message("keypressed", arg1, arg2);