- Home /
Other
Checking if the Mouse Has a Middle Button
The targeting system in my game is turned off by default and is set up to be toggled using the middle mouse button. But I can't guarantee that the player will have a middle mouse button on their mouse.
I set it to one of the axes, so the player can change it as necessary when starting the game up, but is there any way to check if the mouse has a middle button to begin with, so I can prompt the player to reboot the game and choose a different button for it?
Unity doesn't have the option to expose the input manager so I doubt it
Ins$$anonymous$$d of trying to find this, use the alternative: clicking both the left and right buttons at the same time (roughly) = middle mouse click. I tried looking for this, but you can only check for the existence of joysticks.
Sadly, making the player hit both the left and right mouse buttons simultaneously would make them do a ranged and melee attack at the same time as they turn on the targeting system, which would muck things up. The alternative I'm thinking of if this isn't possible is to have the player answer whether they have one or not, in which case the targeting system is turned on by default.
You might be overthinking this. $$anonymous$$ake sure that all of your inputs are fully configurable, ship with the intended control scheme, and point out the configuration options during the game. If somebody doesn't have a $$anonymous$$$$anonymous$$B they can rebind the input. I can't think of a commercial PC game that goes beyond the steps above. Sure, it would be nice if they did - but in the grand scheme of things, you might want to apply your efforts elsewhere.
Answer by TheDavil86 · Jun 24, 2012 at 11:19 AM
Well if you don't have a middle mouse, then you still have the option of using any other button. I suggest just making an alt positive button for that particular button.