Page 1 of 1

String.byte() of love.keypressed(key) argument

Posted: Wed Dec 13, 2017 1:43 pm
by gabberswag
Hey there fellas

To check if the "key" in love.keypressed(key) is a letter from a-z i checked it with string.byte() if its inbetween 97 and 122 and it even worked a bit
BUT For some reason when i press Ctrl or Alt the string.byte() returns 108("f" in ascii)? Shift returns 111 and other keys some weird stuff too probably

Not sure if im missing something there but is there a way around this?

Re: String.byte() of love.keypressed(key) argument

Posted: Wed Dec 13, 2017 2:06 pm
by gabberswag
Oh okay lol it just checks the first letters of "lalt" or "lctrl" strings

See you later fellas

Re: String.byte() of love.keypressed(key) argument

Posted: Wed Dec 13, 2017 11:25 pm
by slime
You should use love.textinput if you want the game to recognize when the user types text.