diff options
author | Lioncash <mathew1800@gmail.com> | 2021-12-14 03:09:28 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2021-12-14 03:22:02 +0100 |
commit | e05d2a70b24e550d67fcdd24aae7094ad41745f8 (patch) | |
tree | af5116d02b99366344c261df03cae992b2e96ae5 /src/input_common/helpers/touch_from_buttons.cpp | |
parent | common/input: Remove unnecessary returns (diff) | |
download | yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.tar yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.tar.gz yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.tar.bz2 yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.tar.lz yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.tar.xz yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.tar.zst yuzu-e05d2a70b24e550d67fcdd24aae7094ad41745f8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/helpers/touch_from_buttons.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/input_common/helpers/touch_from_buttons.cpp b/src/input_common/helpers/touch_from_buttons.cpp index 35d60bc90..ece1e3b32 100644 --- a/src/input_common/helpers/touch_from_buttons.cpp +++ b/src/input_common/helpers/touch_from_buttons.cpp @@ -14,10 +14,13 @@ public: using Button = std::unique_ptr<Common::Input::InputDevice>; TouchFromButtonDevice(Button button_, int touch_id_, float x_, float y_) : button(std::move(button_)), touch_id(touch_id_), x(x_), y(y_) { - Common::Input::InputCallback button_up_callback{ - [this](Common::Input::CallbackStatus callback_) { UpdateButtonStatus(callback_); }}; last_button_value = false; - button->SetCallback(button_up_callback); + button->SetCallback({ + .on_change = + [this](const Common::Input::CallbackStatus& callback_) { + UpdateButtonStatus(callback_); + }, + }); button->ForceUpdate(); } @@ -47,7 +50,7 @@ public: return status; } - void UpdateButtonStatus(Common::Input::CallbackStatus button_callback) { + void UpdateButtonStatus(const Common::Input::CallbackStatus& button_callback) { const Common::Input::CallbackStatus status{ .type = Common::Input::InputType::Touch, .touch_status = GetStatus(button_callback.button_status.value), |