xamarin/urho

Controls.IsPressed() implementation is wrong

pinkplus opened this issue · 0 comments

I believe UrhoSharp's implementation of Controls.IsPressed() is wrong.

In the current implementation, IsPressed() is true when button is down in both current and previous controls. The current implementation is

return ((Buttons & button) != 0) && ((previousControls.Buttons & button) != 0);

Shouldn't it be this? IsPressed() should be true when button is down in the current control but not the previous one.

return ((Buttons & button) != 0) && ((previousControls.Buttons & button) == 0);

See Urho3D's original implementation of Controls.IsPressed().