diff options
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/poller.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/poller.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/input_common/helpers/joycon_protocol/poller.cpp b/src/input_common/helpers/joycon_protocol/poller.cpp index 940b20b7f..7f8e093fa 100644 --- a/src/input_common/helpers/joycon_protocol/poller.cpp +++ b/src/input_common/helpers/joycon_protocol/poller.cpp | |||
| @@ -224,9 +224,9 @@ void JoyconPoller::UpdatePasiveLeftPadInput(const InputReportPassive& input) { | |||
| 224 | Joycon::PasivePadButton::StickL, | 224 | Joycon::PasivePadButton::StickL, |
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | for (std::size_t i = 0; i < left_buttons.size(); ++i) { | 227 | for (auto left_button : left_buttons) { |
| 228 | const bool button_status = (input.button_input & static_cast<u32>(left_buttons[i])) != 0; | 228 | const bool button_status = (input.button_input & static_cast<u32>(left_button)) != 0; |
| 229 | const int button = static_cast<int>(left_buttons[i]); | 229 | const int button = static_cast<int>(left_button); |
| 230 | callbacks.on_button_data(button, button_status); | 230 | callbacks.on_button_data(button, button_status); |
| 231 | } | 231 | } |
| 232 | } | 232 | } |
| @@ -241,9 +241,9 @@ void JoyconPoller::UpdatePasiveRightPadInput(const InputReportPassive& input) { | |||
| 241 | Joycon::PasivePadButton::StickR, | 241 | Joycon::PasivePadButton::StickR, |
| 242 | }; | 242 | }; |
| 243 | 243 | ||
| 244 | for (std::size_t i = 0; i < right_buttons.size(); ++i) { | 244 | for (auto right_button : right_buttons) { |
| 245 | const bool button_status = (input.button_input & static_cast<u32>(right_buttons[i])) != 0; | 245 | const bool button_status = (input.button_input & static_cast<u32>(right_button)) != 0; |
| 246 | const int button = static_cast<int>(right_buttons[i]); | 246 | const int button = static_cast<int>(right_button); |
| 247 | callbacks.on_button_data(button, button_status); | 247 | callbacks.on_button_data(button, button_status); |
| 248 | } | 248 | } |
| 249 | } | 249 | } |
| @@ -259,9 +259,9 @@ void JoyconPoller::UpdatePasiveProPadInput(const InputReportPassive& input) { | |||
| 259 | Joycon::PasivePadButton::StickL, Joycon::PasivePadButton::StickR, | 259 | Joycon::PasivePadButton::StickL, Joycon::PasivePadButton::StickR, |
| 260 | }; | 260 | }; |
| 261 | 261 | ||
| 262 | for (std::size_t i = 0; i < pro_buttons.size(); ++i) { | 262 | for (auto pro_button : pro_buttons) { |
| 263 | const bool button_status = (input.button_input & static_cast<u32>(pro_buttons[i])) != 0; | 263 | const bool button_status = (input.button_input & static_cast<u32>(pro_button)) != 0; |
| 264 | const int button = static_cast<int>(pro_buttons[i]); | 264 | const int button = static_cast<int>(pro_button); |
| 265 | callbacks.on_button_data(button, button_status); | 265 | callbacks.on_button_data(button, button_status); |
| 266 | } | 266 | } |
| 267 | } | 267 | } |