[all versions] certain keyboard inputs ignored
Posted: Sat Jun 07, 2014 3:22 pm
Below is a minimum code loop that works to sense a user keypress and then flash the screen green for 2 seconds to complete the task:The same minimum code snippet executing within the full screen environment does not work.
I can kill the PB session with Alt-F4, so it may not actually be a KeyboardPushed() problem, but that's my best guess.
Code: Select all
; ****** WINDOWED INTERFACE
InitSprite() : InitKeyboard()
OpenWindow(0,0,0,800,600,"SOFTWARE",#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
OpenWindowedScreen(WindowID(0),0,0,800,600,#True,0,0)
; WAIT FOR USER TO PRESS A KEY BEFORE CONTINUING
Repeat
Repeat
X= WindowEvent() : If X = #PB_Event_CloseWindow : End : EndIf
Until X = 0
Delay(20) : ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)
ClearScreen($00FF00) : FlipBuffers() : Delay(2000) : End
I can kill the PB session with Alt-F4, so it may not actually be a KeyboardPushed() problem, but that's my best guess.
Code: Select all
; ****** FULL SCREEN INTERFACE
InitSprite() : InitKeyboard()
OpenScreen(800,600,32,"SOFTWARE")
; WAIT FOR USER TO PRESS A KEY BEFORE CONTINUING
Repeat
Delay(20) : ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)
ClearScreen($00FF00) : FlipBuffers() : Delay(2000) : End