Is it possible to disable mouse wheel and then use right click and left click instead of that?

Hello everyone

I have disabled the mouse wheel event and then I want to use right click and left click for zoom in/out instead of mouse wheel event. I mean when use pointer down I want to zoom to the pointer and when the pointer is up stop moving.

how can i do it?

I use camera.inputs.remove(camera.inputs.attached.mousewheel); to disable the mouse wheel event, but I don’t know how can I use right click and left click for zoom in and out like mouse wheel event.

here is my PG:

Hi @Arash_Bagheri

The “Zoom” effect on ArcRotate Camera is achieved by the changing of its “Radius” property.

Look at the change I did on your PG.

@NRA thanks a lot for answering to my question, on my code there is a zoom to the target with dbClick,
but I don’t want to zoom-in the camera to the target , I want to zoom-in to the mouse pointer, with the mouse scroll wheel it works but I want to change it with mouse pointer-down.

I would look at the source for that camera/input and make your own custom input that mimics it with the changes needed


Exactly what @br-matt said :slight_smile: ping @PirateJC as we were discussing about camera configuration and documentation yesterday


Thanks a lot for answering to my question. :pray: :pray:
sorry for my question, I look at the camera.inputs but I don’t know what should I change to get my result.


Hi, is it possible to help me know how can I change camera configuration to zoom-in/out to the mouse pointer with the pointer-down instead of mouse wheel?

This is not a supported feature, you need to create your own custom inputs for it: Customizing Camera Inputs | Babylon.js Documentation

1 Like