hello ,
i’m working with babylonjs and i want to disabled the zoom with ctrl + to my playground
PG : https://www.babylonjs-playground.com/#31M2AP#97
thanks for help
hello ,
i’m working with babylonjs and i want to disabled the zoom with ctrl + to my playground
PG : https://www.babylonjs-playground.com/#31M2AP#97
thanks for help
ctrl + is a browser feature and not a babylon feature. We won’t add those kind of hacks globally to the playground, but you can add it yourself:
or:
thanks for the reponse @RaananW , i have already used this solution , but not working still anable to add CTRL + after showing popups
It’s a bit out of scope of this forum, but if you want to show an example of code that partly works, please go right a head, we might be able to help!
thanka a lot @RaananW :)))
just use event.preventDefault()
This works when canvas has focus;
https://www.babylonjs-playground.com/#31M2AP#120
use window.addEventlistener for entire page.
(Note; In PG this will add a new eventListener every time you click run without disposing the old one!)
https://www.babylonjs-playground.com/#31M2AP#121
thanks a lot @aWeirdo , it’s still just the control the zoom in/out with CTRL+ mouse wheel .
thanks a lot another time
@Viche same method can be applied to wheel events,
https://playground.babylonjs.com/#20OAV9#2432
so CTRL + wheel still juste doing simple Zoom in/out to scene ? it’s possible to not doing anything with CTRL+ wheel ?
You can completely disable the mouse wheel with camera.inputs.remove(camera.inputs.attached.mousewheel);
If you still want the zoom in/out with the wheel but not with ctrl+wheel, I think you will have to track the ctrl key state in a keyboard handler and add a mouse handler where you disable the wheel action when the ctrl key is down.
thanks a lot amigo