Graphics 640,480,0,0 Local k:Int While Not KeyDown(KEY_ESCAPE) Cls k = GetKey() If k Then Print k Flip Wend End Function GetKey:Int() Const RepeatRate : Int = 100 'ms Global LastTime:Long = MilliSecs() Global LastKey:Int = 0 Local key:Int = 0 While Key <= 226 If KeyDown(key) Then Exit Key:+ 1 Wend If Key = 227 Then Return 0 If Key = LastKey Then If MilliSecs()-LastTime < RepeatRate Then Return 0 EndIf LastTime = MilliSecs() LastKey = Key If Key < 227 Then Return Key Else Return 0 End Function
how to check if any key was pressed
BlitzMax Forums/BlitzMax Beginners Area/how to check if any key was pressedThe Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.