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.