The EventType.MouseUp type of event only seems to call if I click on a handle. This only seems to happen for the left mouse button.
(like after clicking an object and I also happen to have the mouse over the Movement x-axis handle, the event is called)
This is different from if I click the right mouse button, which seems to call the MouseUp event every time the right mouse is clicked.
I'm wondering how to fix this so the MouseUp event is called every time I click the left mouse; like the right mouse button.
The answer to that question seems to be an answer for me but I'm having problems understanding it if anybody can explain it to me, it being in boo makes it harder for me to understand.
This is what I played with to know when the events are called:
No the answer to that question won't help you, that's concerning how to stop the editor screen window from doing things when you click inside it ( for instance select the object you clicked on ), but that's irrelevant here.
Your problem here seems strange though, have you tried using Input.GetMouseButtonUp(0) and Input.GetMouseButtonDown(0) instead? Because those have always worked to me like you described, get called if your button goes up regardless of mouse position.
Okay so if you cannot get the mouseUp event to be registered, fake it:
after reading this, this is the solution I’ve came up with( works on 2019.4.18f1)
if(Event.current.type == EventType.Layout) return;
// Without this you cant get mouse up events dont know why, it also prevents unity to handle some inputs so dont handle layout events otherwise you can move the selected object but cant select a different one
HandleUtility.AddDefaultControl(-1);
var e = Event.current;
// Prevents duplicate key and mouse events
if (e.isMouse || e.isKey)
{
if (e.commandName == "Used")
{
return;
}
e.commandName = "Used";
}
if (e.type == EventType.MouseDown)
{
Debug.Log("Down");
}
if (e.type == EventType.MouseUp)
{
Debug.Log("Mouse Up");
}