getting input

BlitzMax Forums/BlitzMax Beginners Area/getting input

slenkar(Posted 2008) [#1]


I made this input program but it only prints capitals,
does anyone know why?


GfK(Posted 2008) [#2]
Because KeyHit() uses key codes, which are not the same as ASCII codes.

KeyHit() doesn't care if you're trying for an upper case A, or a lower case A. To KeyHit(), its just A.


slenkar(Posted 2008) [#3]
ah ok, how would i get input that distinguishes between upper and lower case letters


GfK(Posted 2008) [#4]
I think you can do it with GetChar but you might need to specifically poll the SHIFT keys and/or CAPS LOCK keys too.

Check the documentation for BRL.PolledInput - everything you need is in there.

:)


InvisibleKid(Posted 2008) [#5]
a quick and dirty way that i do it is as follows



the case numbers are the value of all the keys that i want to know have been pressed or not, in this exampel keys 1-0 ,a-z and A-Z. its not pretty and i'm sure it can be done better, but i hope that helps somewhat


Devlin(Posted 2008) [#6]


I've spent a little time working on this - Needs a bit of work to make it a proper INPUT-like command, but that's elementary stuff fortunately :)


slenkar(Posted 2008) [#7]
oh yeah getchar works thanks everyone