Code: Select all
Procedure callback1()
Debug "Right-arrow key pressed"
EndProcedure
OpenWindow(0,0,0,800,600,"Game",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
AddKeyboardShortcut(0, #PB_Shortcut_Right, 1)
CreatePopupMenu(0) ; dummy, we'll never add items to it or show it
; it exists only to allow the use of BindMenuEvent
BindMenuEvent(0, 1, @callback1())
Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
Code: Select all
BindMenuEvent(#PB_Shortcut, <event>, @<callback>)