Code: Select all
Dim Keyb.i(255)
Debug "Starting..."
If InitSprite() And InitKeyboard()
OpenWindow(0, 30, 30, 640, 480, "Test")
OpenWindowedScreen(WindowID(0), 0, 0, 640, 480, #True, 0, 0, #PB_Screen_NoSynchronization)
Repeat
Delay(10)
Event = WindowEvent()
Select Event
Case #PB_Event_CloseWindow
Debug "ProcessWindowEvents: quit"
Quit = 1
Pause = 0
EndSelect
ExamineKeyboard()
For c = 0 To 255
If KeyboardPushed(c)
If Not Keyb(c)
Keyb(c) = 1
Debug "Key " + Str(c) + " pushed"
EndIf
EndIf
If KeyboardReleased(c)
; Release the key
Keyb(c) = 0
EndIf
Next
Until KeyboardPushed(#PB_Key_Escape) Or Quit
EndIf

