Is it possible to close a window with the space key ?
Code: Select all
Global event
If OpenWindow(0,0,0,800,600,"Close window with <space>",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Repeat
event=WindowEvent()
Select event
Case #PB_Event_CloseWindow
End
; this next code is my invention and it doesn't work
;
; Case #PB_Event_Keyboard
; If EventType()=#PB_Key_Space
; End
; EndIf
EndSelect
ForEver
EndIf