[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mouse.Button , ensure correct right button value
[Thread Prev] | [Thread Next]
- Subject: Re: Mouse.Button , ensure correct right button value
- From: Gianluigi <gradobag@xxxxxxxxxxx>
- Date: Tue, 2 Apr 2024 13:59:33 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Il 02/04/24 12:14, Bruce Steers ha scritto:
I have been helping someone dealing with a mouse event issue and pointed out a possible error in their code. They were using "If Mouse.Button = 2" to detect a right mouse click. I said that could be the problem as on my machine right click is Mouse.Button = 3 They replied that no, right click is Mouse.Button = 2 on their machine. Meaning my recent game that uses Mouse.Button to detect clicks is incorrectly coded as I am assuming right click is 3 So my question would be, is there a way to detect what Mouse.Button value a right click will be? Mouse.Left and Mouse.Right were not good enough as the detection in the MouseDown needs to detect the click , and if you left click while holding right mouse down then the Mouse.Button will be 1 but Mouse.Left and Mouse.Right will both be true so Mouse.Button was a better option. But i did not realize the value of right button can change :-\ I'm now thinking of some workarounds but I'm wondering if there may be a simple way to obtain the valid Button values . Respects. Happy Easter BruceS
I don't know if I understand correctly, but could such a thing help? Public Sub Form_MouseDown() If Not Mouse.Right Then Return Print "You pressed on the right button!" End Regards Gianluigi
Re: Mouse.Button , ensure correct right button value | Bruce Steers <bsteers4@xxxxxxxxx> |
Mouse.Button , ensure correct right button value | Bruce Steers <bsteers4@xxxxxxxxx> |