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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
gabberswag
Prole
Posts: 4
Joined: Fri Aug 12, 2016 10:34 am

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

Post 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?
gabberswag
Prole
Posts: 4
Joined: Fri Aug 12, 2016 10:34 am

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

Post by gabberswag »

Oh okay lol it just checks the first letters of "lalt" or "lctrl" strings

See you later fellas
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

You should use love.textinput if you want the game to recognize when the user types text.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 53 guests