diff options
Diffstat (limited to 'src/input_common/gcadapter/gc_poller.cpp')
| -rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index 977261884..06e16880f 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp | |||
| @@ -96,8 +96,9 @@ Common::ParamPackage GCButtonFactory::GetNextInput() { | |||
| 96 | // or to use a while loop shifting the bits to test and set the value. | 96 | // or to use a while loop shifting the bits to test and set the value. |
| 97 | 97 | ||
| 98 | for (auto button : GCAdapter::PadButtonArray) { | 98 | for (auto button : GCAdapter::PadButtonArray) { |
| 99 | if (pad.button & button) { | 99 | u16 button_value = static_cast<u16>(button); |
| 100 | params.Set("button", button); | 100 | if (pad.button & button_value) { |
| 101 | params.Set("button", button_value); | ||
| 101 | break; | 102 | break; |
| 102 | } | 103 | } |
| 103 | } | 104 | } |
| @@ -105,7 +106,7 @@ Common::ParamPackage GCButtonFactory::GetNextInput() { | |||
| 105 | // For Axis button implementation | 106 | // For Axis button implementation |
| 106 | if (pad.axis != GCAdapter::PadAxes::Undefined) { | 107 | if (pad.axis != GCAdapter::PadAxes::Undefined) { |
| 107 | params.Set("axis", static_cast<u8>(pad.axis)); | 108 | params.Set("axis", static_cast<u8>(pad.axis)); |
| 108 | params.Set("button", GCAdapter::PAD_STICK); | 109 | params.Set("button", static_cast<u16>(GCAdapter::PadButton::PAD_STICK)); |
| 109 | if (pad.axis_value > 128) { | 110 | if (pad.axis_value > 128) { |
| 110 | params.Set("direction", "+"); | 111 | params.Set("direction", "+"); |
| 111 | params.Set("threshold", "0.5"); | 112 | params.Set("threshold", "0.5"); |