Normally I’d create a pause menu using the escape key for my game, I cannot do that when the mouse pointer is locked because pressing the escape key while locked triggers a default behaviour where it unlocks the cursor and completely ignores any events you’d have assigned to that key, you need to press it again.
I tried doing another thing where it checked if the mouse pointer was unlocked to display the pause screen, BUT there’s a problem with this also, it makes it so whatever key you were pressing gets stuck like it’s being held down, so if you were holding the forward key when you pressed escape, you’ll keep moving forward even when not holding it.
The escape key being the pause key is THE standard for first person games or pretty much every single computer game with keyboard controls, what am I supposed to do???
Using the MousePointerLock extension. Heads up I’ve heard things about the default javascript mouse pointer lock behaviour being impossible to work around thanks to the standards set by browsers, but the keys getting stuck is specially horrible.