Search code examples
c#onmouseclick

Checking clicks against MouseButtons.Right


In a mouseclick handler, is the correct way to know whether to show a context menu to check the event's Button property against MouseButtons.Right? If so, wouldn't there be a problem when a (probably left-handed) user tries to use your application with the mouse buttons reversed?


Solution

  • No it won't be a problem if mouse buttons are reversed.

    Lets says I have reversed my mouse buttons, so when I press left mouse button, Windows will raise event for MouseButtons.Right and similarly MouseButtons.Left when right button is pressed.