getting input
BlitzMax Forums/BlitzMax Beginners Area/getting input
| ||
I made this input program but it only prints capitals, does anyone know why? |
| ||
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. |
| ||
ah ok, how would i get input that distinguishes between upper and lower case letters |
| ||
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. :) |
| ||
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 |
| ||
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 :) |
| ||
oh yeah getchar works thanks everyone |