Scancodes -> ASCII

BlitzMax Forums/BlitzMax Beginners Area/Scancodes -> ASCII

(tu) ENAY(Posted 2005) [#1]
Has anyone written any scan code library in Blitzax for when you hit a key?

So I don't have to do something like:-

If KeyHit(KEY_Q) then return "Q"
If KeyHit(KEY_W) then return "W"
etc

Thanks :)


SSS(Posted 2005) [#2]
well... chr(key) does it just fine...

here's some input code that i use.. its not perfect but it works.
Function BuiKeyPress()
	Local i
	For i = 8 To 191
		If (i<>KEY_LSHIFT And i<>KEY_RSHIFT And i<>KEY_SHIFT) And KeyHit(i) Then Return i
	Next
	Return -1
End Function



(tu) ENAY(Posted 2005) [#3]
Cheers dude. I'll give it a whirl. :)


skidracer(Posted 2005) [#4]
Use GetChar for dealing with user typed input of an ascii nature.


(tu) ENAY(Posted 2005) [#5]
GetChar RULES! :) Thanks Simon