Forum

disable pause key (P)

06 December 2018 13:32
i just noticed that pressing P pauses the engine, even if letter_controls are disabled.

is there a way to prevent this behaviour?

and are there other keys doing things we should know about?
06 December 2018 20:22
i just noticed that pressing P pauses the engine, even if letter_controls are disabled.

is there a way to prevent this behaviour?
Yes, by adding

key_pause_enabled:false

to the m_app.init() param.

See here: https://www.blend4web.com/en/forums/topic/4807/?page=1#post-22327

and are there other keys doing things we should know about?
I agree. It would be nice to have a table where all the default keybindings of B4W are listed.

It would also be great to be able to remap the keys oneself. I was always looking for a way to use ESC instead of P for m_main.pause() and m_main.resume(), but once the engine is paused, it no longer reacts to ESC (which is the key that comes natural to any user), but it does react to P (which is a stupid key that nobody ever thought or heard of ).
13 December 2018 19:58
awesome! thank you

i will try it tomorrow. edit: it works! nice

well, you can always add a javascript key listener and check for esc
13 December 2018 21:51
Exactly. I think they used P for a reason though, because P is unused by default whereas keys like ESC, F11 etc. may already be bound to browser functions (pointerlock, fullscreen etc.). Also, P exists on any keyboard / keyboard emulation, whereas ESC may not.
 
Please register or log in to leave a reply.