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 { | |||
| 11 | class TouchFromButtonDevice final : public Input::TouchDevice { | 11 | class TouchFromButtonDevice final : public Input::TouchDevice { |
| 12 | public: | 12 | public: |
| 13 | TouchFromButtonDevice() { | 13 | TouchFromButtonDevice() { |
| 14 | for (const auto& config_entry : | 14 | const auto button_index = |
| 15 | Settings::values.touch_from_button_maps[Settings::values.touch_from_button_map_index] | 15 | static_cast<std::size_t>(Settings::values.touch_from_button_map_index); |
| 16 | .buttons) { | 16 | const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
| 17 | |||
| 18 | for (const auto& config_entry : buttons) { | ||
| 17 | const Common::ParamPackage package{config_entry}; | 19 | const Common::ParamPackage package{config_entry}; |
| 18 | map.emplace_back( | 20 | map.emplace_back( |
| 19 | Input::CreateDevice<Input::ButtonDevice>(config_entry), | 21 | Input::CreateDevice<Input::ButtonDevice>(config_entry), |
| @@ -42,8 +44,7 @@ private: | |||
| 42 | std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; | 44 | std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; |
| 43 | }; | 45 | }; |
| 44 | 46 | ||
| 45 | std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create( | 47 | std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create(const Common::ParamPackage&) { |
| 46 | const Common::ParamPackage& params) { | ||
| 47 | return std::make_unique<TouchFromButtonDevice>(); | 48 | return std::make_unique<TouchFromButtonDevice>(); |
| 48 | } | 49 | } |
| 49 | 50 | ||