Unity bug when scrolling on touchpad
In unity on windows version there is a problem when scrolling with the touchpad.
It is possible to get the scroll delta but inside the OnGUI method.
I have added these code snippet in the ProcessEvent method in NoesisUIRenderer and it solves the problem
I wanted to verify if this can intefere when processing other events?
It is possible to get the scroll delta but inside the OnGUI method.
I have added these code snippet in the ProcessEvent method in NoesisUIRenderer and it solves the problem
Code: Select all
case UnityEngine.EventType.scrollWheel:
{
UnityEngine.Vector2 mouse = ProjectPointer(ev.mousePosition.x,UnityEngine.Screen.height - ev.mousePosition.y);
Noesis_MouseWheel ( _rendererId, mouse.x, mouse.y, (int)UnityEngine.Event.current.delta.y);
break;
}
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: Unity bug when scrolling on touchpad
Do you mean that using the touch pad to scroll doesn't generate values for the Input.GetAxis("Mouse ScrollWheel")?
If that is the case, we should probably abandon that path and use only the EventType.ScrollWheel event from OnGUI only. I can't remember if we didn't use it for any good reason, we will investigate it.
Meanwhile, if you modify the code, you should write something like this:
If that is the case, we should probably abandon that path and use only the EventType.ScrollWheel event from OnGUI only. I can't remember if we didn't use it for any good reason, we will investigate it.
Meanwhile, if you modify the code, you should write something like this:
Code: Select all
switch (ev.type)
{
case UnityEngine.EventType.ScrollWheel:
{
if (enableMouse)
{
int mouseWheel = -(int)(ev.delta.y * 10.0f);
if (mouseWheel != 0)
{
UnityEngine.Debug.Log(mouseWheel);
UnityEngine.Vector2 mouse = ProjectPointer(ev.mousePosition.x,
UnityEngine.Screen.height - ev.mousePosition.y);
Noesis_MouseWheel(_rendererId, mouse.x, mouse.y, mouseWheel);
}
}
break;
}
//...
}
Re: Unity bug when scrolling on touchpad
It does not, there were some topics on unity forums about this.
I have a keyboard with a touchpad where the input is generated
and a laptop with the touchpad where the input is not generated.
Thanks for the help.
I have a keyboard with a touchpad where the input is generated
and a laptop with the touchpad where the input is not generated.
Thanks for the help.
Who is online
Users browsing this forum: Ahrefs [Bot], dstewart and 7 guests