xamarin / urho

Code to integrate with the Urho3D engine
Other
462 stars 122 forks source link

Controls.IsPressed() implementation is wrong #382

Open pinkplus opened 5 years ago

pinkplus commented 5 years ago

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().