Skip to content

Commit

Permalink
fix(hid): Clear all matching usages, not just first.
Browse files Browse the repository at this point in the history
* If various events get dropped, we can end up with duplicate
  codes in our report, so tweak to ensure we look for all matches
  and clear them when we have a keycode released.
  • Loading branch information
petejohanson committed Jan 15, 2021
1 parent a0c32bb commit c11759b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ int zmk_hid_unregister_mod(zmk_mod_t modifier) {
continue; \
} \
keyboard_report.body.keys[idx] = val; \
break; \
if (val) { \
break; \
} \
}

#define TOGGLE_CONSUMER(match, val) \
Expand All @@ -64,7 +66,9 @@ int zmk_hid_unregister_mod(zmk_mod_t modifier) {
continue; \
} \
consumer_report.body.keys[idx] = val; \
break; \
if (val) { \
break; \
} \
}

int zmk_hid_implicit_modifiers_press(zmk_mod_flags_t implicit_modifiers) {
Expand Down

0 comments on commit c11759b

Please sign in to comment.