Detecting user input while engine is paused

11 May 2018 22:33
The engine is paused and resumed with m_main.pause() and m_main.resume().

I would like to implement the ability for the user to pause the engine with ESC (for example, ESC pauses the engine and brings up a menu) and then resume with another ESC keypress (in other words, ESC toggles the menu - a standard feature in almost every game/application). This is not possible in B4W because keyboard detection is paused along with the engine, so after .pause(), you cannot .resume() the engine with a keypress.

For now, I'm using a workaround by adding my own ESC detection, but it's a bit wonky because it obviously interferes with the engine's key detection while the engine is not paused.

I would prefer to use the engine's API, but for that, input detection would have to be excluded from the things shut down by m_main.pause().
Please register or log in to leave a reply.