Page 1 of 1
Problem with KeyboardPushed(#PB_Key_Pause)
Posted: Sat Aug 24, 2024 1:12 pm
by Psychophanta
In a full screen environment, the pause key seems to fail here.
In the main loop i do:
Code: Select all
ExamineKeyboard()
...
ElseIf KeyboardPushed(#PB_Key_Pause)
Repeat:FlipBuffers():Delay(21):ExamineKeyboard():Until KeyboardPushed(#PB_Key_Pause)=0
...
FlipBuffers()
and it does not work, but with any other key it does work

Re: Problem with KeyboardPushed(#PB_Key_Pause)
Posted: Sat Aug 24, 2024 1:28 pm
by BarryG
Re: Problem with KeyboardPushed(#PB_Key_Pause)
Posted: Sat Aug 24, 2024 4:35 pm
by Psychophanta
Thanks, looks like another inherited IBM-PC-XT hardware bug.

Re: Problem with KeyboardPushed(#PB_Key_Pause)
Posted: Mon Aug 26, 2024 10:51 am
by benubi
Two things you may overlook
1) You may flush directly through the loop. Use KeyboardReleased() on the first check behind ElseIf. The way you check the user has to quickly release the button and what happens when he started pressing it 1ms before frame flip but average holding time is 25ms? Right, you flush through the loop and the Pause key is believed pressed/released again when in fact it was the same push event.
2) You may also need to process window events since they can carry mouse and keyboard inputs into your app
What could be of use would be a 3rd keyboard query function in the library to check for keyboard hits, checking if the key has been pressed for the "first" time. I tried to implement such things myself but on Linux I met difficulties because some #PB_Key_ constants have negative values, or are above 256, which makes it complicated to implement without a Map or so.