[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mouse.Button , ensure correct right button value


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

Follow-Ups:
Re: Mouse.Button , ensure correct right button valueBB <adamnt42@xxxxxxxxx>
Re: Mouse.Button , ensure correct right button valueGianluigi <gradobag@xxxxxxxxxxx>