- Home /
How to use Trackpoint middle mouse button for scrolling,
I'm using a ThinkPad Notebook. I want to use my trackpoint middle mouse button for zooming in and out, basically like the Unity Scene View responds to it (just like scrolling the scroll wheel).
Using the scroll wheel of my external mouse already works, but I can't seem to get the input from the trackpoint. In any other program on my PC it "just works" (apart from Monodevelop, but thats probably another issue). Even in the Unity Scene View it works like the scroll wheel.
Neither print(Input.GetAxis("Mouse ScrollWheel"));
nor print(Input.mouseScrollDelta);
output anything when using the trackpoint (but they do for the scroll wheel). I can't even get it to recognize that the middle button was pressed, none of if(Input.GetKeyDown(KeyCode.Mouse0..6)) print("Mouse0..6");
responde to it. (Scrollwheel of external mouse is Mouse2, Mouse0 and Mouse1 work just the same on trackpoint and external).
Edit: I'm using a ThinkPad T520 with W7 and it says that the driver for my "ThinkPad UltraNav Pointing Device" is up to date.
Now I even tried iterating through ALL $$anonymous$$eycodes, but none of them equal my middle mouse button...
foreach ($$anonymous$$eyCode k in Enum.GetValues(typeof($$anonymous$$eyCode))) { if(Input.Get$$anonymous$$eyDown(k)) print(k); }
This outputs correct for the left and right mousbutton, but nothing for the middle one...
Answer by niorg2606 · Jan 04, 2018 at 09:15 PM
I have a ThinkPad as well, and all I have to tell you is that the middle mouse button is NOT the scrolling part of the scroll wheel. It is like pushing the scroll wheel down on an external mouse, so that would explain why the Input.GetAxis isn't working. The reason that the GetKey isn't working is because the mouse buttons aren't keys. Try this instead with Mouse Button 3.
Hm, no that doesn't work either. "if (Input.Get$$anonymous$$ouseButtonDown(0..1)) print("$$anonymous$$ouse0..1");" does work, but none of "if (Input.Get$$anonymous$$ouseButtonDown(2..6)) print("$$anonymous$$ouse2..6");" output anything. Just the same as the "if(Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.$$anonymous$$ouse0..6)) print("$$anonymous$$ouse0..6");"
Just to make sure, you are talking about the button in between the left and right mouse buttons, right?
Yes, exactly this button. The one with the blue dottet line which is "the wrong way round" inbetween the two mouse buttons with the red lines.