diff options
Diffstat (limited to 'src/core/frontend/input_interpreter.h')
| -rw-r--r-- | src/core/frontend/input_interpreter.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/frontend/input_interpreter.h b/src/core/frontend/input_interpreter.h index fea9aebe6..36a92a6b6 100644 --- a/src/core/frontend/input_interpreter.h +++ b/src/core/frontend/input_interpreter.h | |||
| @@ -67,6 +67,27 @@ public: | |||
| 67 | void PollInput(); | 67 | void PollInput(); |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | * Checks whether the button is pressed. | ||
| 71 | * | ||
| 72 | * @param button The button to check. | ||
| 73 | * | ||
| 74 | * @returns True when the button is pressed. | ||
| 75 | */ | ||
| 76 | [[nodiscard]] bool IsButtonPressed(HIDButton button) const; | ||
| 77 | |||
| 78 | /** | ||
| 79 | * Checks whether any of the buttons in the parameter list is pressed. | ||
| 80 | * | ||
| 81 | * @tparam HIDButton The buttons to check. | ||
| 82 | * | ||
| 83 | * @returns True when at least one of the buttons is pressed. | ||
| 84 | */ | ||
| 85 | template <HIDButton... T> | ||
| 86 | [[nodiscard]] bool IsAnyButtonPressed() { | ||
| 87 | return (IsButtonPressed(T) || ...); | ||
| 88 | } | ||
| 89 | |||
| 90 | /** | ||
| 70 | * The specified button is considered to be pressed once | 91 | * The specified button is considered to be pressed once |
| 71 | * if it is currently pressed and not pressed previously. | 92 | * if it is currently pressed and not pressed previously. |
| 72 | * | 93 | * |