- Home /
people using macs please help (mouse scroll wheel test)
i have a problem with mouse scroll...it was reported to me that mouse scroll on macs does not work, in fact it works for some time then it stucks...can somebody verify this to me?
here is the link to the build: http://bookjungle.com/TESTS/scroll.html
also it seems that it does not calculate properly, in the Input settings i have sensitivity set to 0.25 but radius updates in 0.1 increments. is there efficient way to make sure values are correct and in appropriate format?
here is the code:
var radius : float=2.0;
function OnGUI() {
//GET MOUSE SCROLL WHEEL AXIS VALUE (RANGE -0.5 TO 0.5)
var scroll : float=Input.GetAxis("Mouse ScrollWheel");
Debug.Log(scroll.ToString());
//CALCULATE RADIUS BASED ON MOUSE SCROLL WHEEL AXIS
radius+=scroll*0.1;
//LIMIT RADIUS
if(radius>=4.5){
radius=4.5;
} else if(radius<=0.0){
radius=0.0;
}
//DISPLAY VALUES
GUI.Label(Rect(5,5,250,20),"Mouse ScrollWheel Axis: " + scroll.ToString());
GUI.Label(Rect(5,20,250,20),"Radius: " + radius.ToString());
}
It works fine with inertial scrolling on my mul$$anonymous$$ch trackpad. Here's something you might like: http://unity3d.com/support/documentation/ScriptReference/$$anonymous$$athf.Clamp.html
Works fine for me too, on $$anonymous$$acBook Pro 2010 trackpad.
I have a Rapoo GX10 mouse attached to a $$anonymous$$acBook Pro running OSX 10.6.6 and tested your Unity Player file in the latest Opera. (Safari wouldn't open it) I also got the .1 increments you're talking about. But after 2 $$anonymous$$utes of twiddling, no freeze. However the numbers were getting increasingly complex. 1.199999999 etc.