summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/input_interpreter.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-01-16 16:34:39 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-01-16 16:34:39 +0100
commit3c8f936b31c310a3ad037cc2e260b53d07577fcf (patch)
treebef1999d57e5106a379fc9ac19acb01d84913085 /src/core/frontend/input_interpreter.cpp
parentMerge pull request #5275 from FernandoS27/fast-native-clock (diff)
downloadyuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.tar
yuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.tar.gz
yuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.tar.bz2
yuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.tar.lz
yuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.tar.xz
yuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.tar.zst
yuzu-3c8f936b31c310a3ad037cc2e260b53d07577fcf.zip
Diffstat (limited to '')
-rw-r--r--src/core/frontend/input_interpreter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/frontend/input_interpreter.cpp b/src/core/frontend/input_interpreter.cpp
index 66ae506cd..ec5fe660e 100644
--- a/src/core/frontend/input_interpreter.cpp
+++ b/src/core/frontend/input_interpreter.cpp
@@ -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;