How to disable arrows keys

Hello, how can I cancel arrows keys on pg screen in babylonjs. The screen should not be navigated with arrow keys. Can you help me?

image

Just for fun :slight_smile: Maybe it will help someone | Babylon.js Playground (babylonjs-playground.com)

Here are all docs - Customizing Camera Inputs | Babylon.js Documentation

4 Likes

Thanks for the information you provided. I spent a long time in the document but was able to find the answer.

Answer:
camera.inputs.remove(camera.inputs.attached.keyboard);

Just for fun :slight_smile: Maybe it will help someone | Babylon.js Playground (babylonjs-playground.com)

If it is used in html and the scroll moves with the arrow keys, the solution is:
window.addEventListener(“keydown”, function (e) {
if ([“Space”, “ArrowUp”, “ArrowDown”, “ArrowLeft”, “ArrowRight”].indexOf(e.code) > -1) {
e.preventDefault();
}
}, false);

5 Likes