- Home /
Mac/Safari Mouse Input Bug?
I am experiencing a mouse input issue when I play my game with webplayer and Safari on a Mac.
I reproduced the issue on the first 3 Macs I tested with, so I wrote a small test script to investigate further. I find it hard to believe this wouldn't be a known issue, though.
Issue Description:
If both mouse buttons (left and right) are held down at the same time, only one of the two "mouse up" events will be detected. The first button's release will be detected correctly, but after the second button is released Input.MouseButtonUp(buttonNumber) will continue to return true.
How to reproduce:
- play game in webplayer mode using Safari on Mac
- Mac OS 10.6.7
- Safari 5.0.5
- hold down both mouse buttons (left + right)
- release left button
- Input.getMouseButton(1) continues to return true in Update() function
Here's my test script:
var isLeftButtonDown : boolean = false; var isRightButtonDown : boolean = false;
function Update () { isLeftButtonDown = Input.GetMouseButton(0); isRightButtonDown = Input.GetMouseButton(1); }
function OnGUI () { var labelRectangle = Rect(100, 100, 200, 200);
var msg : String = "";
msg += "\n Left Button: " + isLeftButtonDown;
msg += "\n Right Button: " + isRightButtonDown;
GUI.Label(labelRectangle, msg);
}
I attach the above script to an empty GameObject in my scene and create a webplayer build. If I open that with Safari on a Mac the output confirms that something bizarre is happening.
Maybe somebody else can confirm this on their machine?
It would be better if you submitted that as a bug report ins$$anonymous$$d of posting it here.
It's actually not bad practice to ask here to confirm if it's a bug or a scripting error/machine error on his side. I cannot check it for you though, I'm on a windows machine.