Detecting Configuration of Mouse Buttons

I am starting to remap mouse buttons for the different functionality of my project. I want to use the middle mouse button for zoom and rotate (arcRotate Camera). But, not every mouse has a middle mouse button.

Is there a way to detect if a physical hardware mouse has a middle button in JS or even higher level in the engine?

Every time I search for this, the results that return are for detecting a mouse button (press) which is not what I want. I want to know how many buttons are on a user’s mouse, so I can map them appropriately.

Also, if the middle mouse wheel / button do not exist (trackpads and some MAC mice, I am looking at you), what would graceful fallback input mapping code look like to remap mouse inputs to some other button or key look like?

I am not aware of such APIs in JS maybe @RaananW know it ?

User input is abstracted for the user using events. Mouse and keyboard are both considered native inputs (mouse and touch moving to pointers, but it is still the same thing) so there is no API to detect them. they are just … there.
As opposed to the Gamepad API there is no Pointer / Mouse API (AFAIK it is not planned as well). You can get some information from the navigator object (like the maxPointerPoints) but not the amount of buttons available. There is an experimental Keyboard API that might help with detecting the keyboard layout.

OK, thanks guys, I will have to go a different route then.