Skip to content

Commit 56c4c6d

Browse files
committed
inputs: don't overwrite buttons in every iteration of the loop
1 parent a33721c commit 56c4c6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ fn main() -> ! {
214214
}
215215
if index < 2 {
216216
// Actual buttons
217-
report.buttons = 1 << index;
217+
report.buttons |= 1 << index;
218218
} else if index < 2 + 4 {
219-
report.buttons = 1 << (index + 2);
219+
report.buttons |= 1 << (index + 2);
220220
} else if index < 2 + 4 + 1 {
221-
report.misc_buttons = 1 << 4;
221+
report.misc_buttons |= 1 << 4;
222222
} else if index < 2 + 4 + 1 + 4 {
223223
// Joysticks
224224
let value = if index & 1 == 1 { i16::MAX } else { i16::MIN };

0 commit comments

Comments
 (0)