diff options
Diffstat (limited to 'src/input_common/touch_from_button.cpp')
-rw-r--r-- | src/input_common/touch_from_button.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index 98da0ef1a..a07124a86 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp @@ -11,9 +11,11 @@ namespace InputCommon { class TouchFromButtonDevice final : public Input::TouchDevice { public: TouchFromButtonDevice() { - for (const auto& config_entry : - Settings::values.touch_from_button_maps[Settings::values.touch_from_button_map_index] - .buttons) { + const auto button_index = + static_cast<std::size_t>(Settings::values.touch_from_button_map_index); + const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons; + + for (const auto& config_entry : buttons) { const Common::ParamPackage package{config_entry}; map.emplace_back( Input::CreateDevice<Input::ButtonDevice>(config_entry), @@ -42,8 +44,7 @@ private: std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; }; -std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create( - const Common::ParamPackage& params) { +std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create(const Common::ParamPackage&) { return std::make_unique<TouchFromButtonDevice>(); } |