Add methods IsAnyKeyDown on Mouse/Gamepad class

This commit is contained in:
Ruan Lucas
2023-01-19 15:21:50 -04:00
parent 1e98fe2920
commit 8669a291fb
4 changed files with 30 additions and 0 deletions

View File

@@ -31,6 +31,15 @@ void Gamepad::ResetState()
_mappedPrevState.Clear();
}
bool Gamepad::IsAnyKeyDown() const
{
// TODO: optimize with SIMD
bool result = false;
for (auto e : _state.Buttons)
result |= e;
return result;
}
bool Gamepad::Update(EventQueue& queue)
{
// Copy state