getting input from "Mouse ScrollWheel"

I am trying to get input from the scroll wheel. I know that the scrollwheel works in in the IDE. I reset the the input settings to element 8 is “Mouse ScrollWheel”
My code is

	def Update (): 
		Debug.Log("got here");
		if (Input.GetButton ("Mouse ScrollWheel")):
			Debug.Log("${name}");
		delta = Input.GetAxis ("Mouse ScrollWheel"); 
		Debug.Log("${name}::${delta}");

(the code is boo but just pretend it is JS that looks funny)
The code is called because Debug.Log(“got here”) prints and Debug.Log(“{name}::{delta}”) prints but with 0 for delta always. Debug.Log(“${name}”); does not print. This is unity 2.x I have tried both an apple mouse and my logicool mouse.
Any suggestions?

Cheers,
Grant

Hmm, it does appear that ScrollWheel input is not working correctly. We’ll get this in the pipe and fix it asap. Sorry for the inconvenience!

We’ve seen that scroll wheel works on some mice/inputs but not others. On a few machines here it sometimes work for external mice (but always for the trackpad). The same machine will go back to working later; no idea why!

Just rebooted and mouse is plugged in a different port and only one mouse this time. Mouse works, trackpad does not for scrolling in ap. both work in IDE Scene.

Cheers,
Grant

Maybe a little “Scrollwheel to switch weapons” in the fps tutorial once things are up and running in the examples areas?

:idea:

AC

Is there any new information on this issue? I’m using Unity 2.0.2 and I can’t get the Mouse ScrollWheel to work at all (MacBook Pro + Mighty Mouse, MacOS 10.5.2)… It’s critical for my project!

Thanks…


David Robinson
Coole Immersive, Inc.

This sounds a lot like the still-open bug I filed about 8 months ago, 11489.

Basically scroll input will only work for one input device, and you have to restart Unity to change that one.

So if you have a trackpad with scrolling, and a mouse plugged in, only one will work at a time.

-Jon

I know this is an old thread, but I just encountered this bug in Unity 2.5.0. Is it still not fixed?

When I run my game, either in the editor or as a stand-alone binary, my mouse’s scroll wheel does not work. Only the trackpad works for scrolling, but I normally have the trackpad disabled when a mouse is connected. I also tried a trackball. Same result. These are both Logitech devices.

This bug only occurs under OS X. The same code in the same game works fine under Windows (Vista, to be precise) on the same machine.

I can’t believe this bug is still not fixed after 20 months. It’s critical. I can’t release my game with the caveat that the scroll wheel may not work under OS X. What would my customers think? Please, please fix it or provide a workaround ASAP!

BTW, is the Unity bug database available online? Being able to see which bugs are known and what their status is would be very helpful when strange behavior like this is encountered.

1 Like

+1

If you haven’t already, be sure to file a bug report. The devs don’t always catch things posted on the forums.

Negative, it appears to be un-fixed. I checked the original bug (#11489) and it’s open against engineering but clearly not fixed in the shipping build.

We can’t get to everything and sadly some stuff, like this issue, can unfortunately slip by a bit longer than they ought to. When you encounter situations like this don’t just vent here, ping someone (me! :)) and let me know so I can add fresh comments to the internal bug to float it back to the top if necessary (in this case I’ve already done that now).

No, our bug database isn’t publicly available.

I understand that you need to prioritize bugs, and some bugs will end up at the bottom of the pile. I’m a programmer, and I know that zero defects is an unrealistic goal. I was just surprised that a bug that probably affects a lot of people could go unfixed for so long.

Maybe most Unity games don’t use the scroll wheel, but most shooters and RPGs need it to control camera zoom, weapon selection, or scope zoom. I’m making a shooter, so having a working scroll wheel is important to my game.

Thanks, Higgy! I appreciate you updating the bug. I didn’t mean my comment to come across as a vent. I love Unity and UT. Thanks to you guys, I’m finally able to make my lifelong dream of creating my own game happen – as soon as this bug is fixed. :stuck_out_tongue: (I’m actually at least six months from being done with my game. Hopefully the bug will be fixed by then.)

Look, in my world the occasional vent is a necessary thing to do. I just want to be sure that the energy expended in venting does more than just heat the air around your steaming noggin’! As such I offer myself as a sounding board as I can take the commentary and hopefully put that to use through bug nudging and whatnot. :slight_smile:

So no worries on the commentary, I just wanted you to know that I’m here if/when you come across something like this again in the future. Rock on!

so the issue is with multiple devices then? Thats how I read it, because my mousescroll works here:

	var currentWeapon = 0; 
	var numWeapons = 1; 
	function Awake () {
	// Select the first weapon
	SelectWeapon(0);
}


function Update () {

	// Did the user press fire?
	if (Input.GetButton ("Fire1"))
		BroadcastMessage("Fire");
		
	if (Input.GetAxis("Mouse ScrollWheel") < 0){
		
 	  if (currentWeapon + 1 <= numWeapons){
	   currentWeapon++;
	   } else {
 
 	  currentWeapon = 0;
  	
  		 }
		   SelectWeapon(currentWeapon);
			} else if (Input.GetAxis("Mouse ScrollWheel") > 0){
 			
 			  if (currentWeapon - 1 >= 0){
  		 currentWeapon--;
  		 
 		  } else {
   currentWeapon = numWeapons;
   }
   SelectWeapon(currentWeapon);
}
	if (Input.GetKeyDown("1"))
	{
		SelectWeapon(0);
	}	
	else if (Input.GetKeyDown("2"))
	{
		SelectWeapon(1);
	}	
}

function SelectWeapon (index : int) {
	for (var i=0;i<transform.childCount;i++)
	{
		// Activate the selected weapon
		if (i == index)
			transform.GetChild(i).gameObject.SetActiveRecursively(true);
		// Deactivate all other weapons
		else
			transform.GetChild(i).gameObject.SetActiveRecursively(false);
	}
}

I cant speak for multiple devices but this works for my mousewheel.

HTH
AC

Yes, the issue is with multiple devices (but only under OS X, not Windows).

I’m using a MacBook Pro, and Unity only recognizes the “scroll wheel” on my trackpad. It ignores the scroll wheel on my mouse. Since I normally have my trackpad disabled when a mouse is connected, my game receives input from neither scroll wheel.

Oddly, the Unity editor has no trouble receiving input from both scroll wheels.

Hmm Im using a macbook pro too with a mouse so its obviously a sometimes bug. I’ll shut up now as I dont really have anything useful to offer.

good luck

AC

Interesting. What type of mouse do you have? I’m using a Logitech MX Revolution. The bug also occurs when I use a Logitech trackball. Perhaps the bug is triggered by the Logitech Control Center software.

Could be; some input software like USBOverdrive doesn’t work well with Unity, where scroll events are detected in the editor, but not in a build. I switched to SteerMouse, which works fine in both cases. (I filed a bug about the USBOverdrive behavior nearly 3 years ago, which is still open, but I don’t blame UT for not getting every third-party hack to work…)

–Eric

just a $2 USB “elecom” found in the specials box at my local computer store.

AC

I’ve confirmed that this bug is triggered by the Logitech Control Center software. I uninstalled the software, and the scroll wheel now works fine. Unfortunately, this means losing access to all the cool features of my mouse. So I installed SteerMouse, and the scroll wheel continues to work fine. :smile:

Uninstalling the Logitech software also fixed a problem I had with WoW: Whenever I used the scroll wheel in WoW, the pointer was reset to the upper-left corner of the screen. That doesn’t happen now.

Clearly Logitech’s Control Center software is causing the problem. This may not even be a bug in Unity. However, Logitech mice are popular, and most people who buy Logitech mice are going to use the Logitech software that comes with the mouse. So if there is any way the devs can correct or work around this issue, I would really appreciate it. I can warn my customers that the scroll wheel won’t work if they use Logitech’s software, but I would prefer to have it just work.

Thanks to everyone for your help in deducing the real cause of this issue!