- Home /
Trackpad and Mouse can't fix scroll speed!
In my game, I'm trying to zoom the camera in when scrolling. I'm using Input.GetAxis("Mouse ScrollWheel")
and there are no complaints there.
However, scrolling with my mouse zooms in (roughly) 5 times slower than with my trackpad! I need both my mouse and trackpad to scroll at (roughly) the same speed.
Here's what I've tried to no avail:
Adjusting the mouse scroll speed in my laptop settings.
Adjusting the trackpad speed in my laptop settings (couldn't adjust trackpad scrollspeed).
Using
OnGui()
to check if I was scrollingif (Event.current.type == EventType.ScrollWheel)
via mouse or trackpadif (Input.mouseScrollDelta.y == 0) use Trackpad
.
I've tried number 3 for hours in all kinds of different ways and I couldn't get it to work.
Something weird I found out was that, checking for mouseScrollDelta.y, it would always be 0 if I wasn't focused on the game window, and use rounded up trackpad speed if I was.
Windows 10, Unity 2018.1.6f1.
I don't know what to do anymore.
Answer by hectorux · Jul 04, 2018 at 11:52 PM
Make a variable called speed and mult it to your Mouse ScrollWheel
That works for the mouse, but then the trackpad scrolls way too fast! I need a way to know when I'm using the mouse and when I'm using the trackpad, and as I've stated, Input.mouseScrollDelta.y is inaccurate.
Your answer
Follow this Question
Related Questions
Menu button needs to be double clicked. 4 Answers
Invert horizontal scrolling with mouse wheel on ScrollRect 1 Answer
Repositioning Items in ScrollRect During Scroll While Maintaining Offset 0 Answers
Is it possible to distinguish between mouse and trackpad scroll? 3 Answers
Using delta to find mouse movement 1 Answer