mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 05:57:58 -05:00
input_interpreter: Add method to check for a button press state
This allows to check for continuous input for the duration of a button press/hold
This commit is contained in:
@ -25,6 +25,10 @@ void InputInterpreter::PollInput() {
|
||||
button_states[current_index] = button_state;
|
||||
}
|
||||
|
||||
bool InputInterpreter::IsButtonPressed(HIDButton button) const {
|
||||
return (button_states[current_index] & (1U << static_cast<u8>(button))) != 0;
|
||||
}
|
||||
|
||||
bool InputInterpreter::IsButtonPressedOnce(HIDButton button) const {
|
||||
const bool current_press =
|
||||
(button_states[current_index] & (1U << static_cast<u8>(button))) != 0;
|
||||
|
Reference in New Issue
Block a user