Any way to check if any key was pressed?

BlitzMax Forums/BlitzMax Programming/Any way to check if any key was pressed?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Graphics 640, 480, 0, 0

AddHook EmitEventHook,KeyHook,Null,0

Function KeyHook:Object( id,data:Object,context:Object )

	Local event:TEvent=TEvent(data)
	Select event.id
		Case EVENT_KEYDOWN
			Print event.data
	End Select
	Return data

End Function


While Not KeyDown(KEY_ESCAPE)
	Cls
	Flip
Wend
End


Swap the Print event.data for a Select..Case with the keycodes you want to check.