0

I would like to know if it is possible to disable the ESCAPE option (using PointerLockControls and ThreeJS) when pressing escape on your keyboard.

I want to use this key for another purpose in my project!

Thanks in advance for any help!

fjavier10
  • 31
  • 5

1 Answers1

1

AFAIK, no. This behavior can't be controlled by an app. It's important for the usability that the user can always escape the pointer lock in a default manner.

Mugen87
  • 28,829
  • 4
  • 27
  • 50
  • I know the importance for the usability, but I want to open a menu (like a menu game where you can see your objects, etc) by pressing escape. I could show the user how to escape by pressing another key. It's possible to change the key????? That's my question. I want to escape pressing another key. – fjavier10 Jun 13 '18 at 11:20
  • No, sorry. Even if you set an event listener to the `keydown` event, it's not possible to catch the press on `escape` while pointer lock is active and prevent the default behavior. You have to open your menu with a different key. – Mugen87 Jun 13 '18 at 13:03