Skip to content

Commit

Permalink
fix(combo): fix combo output key getting stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
pcasotti committed Jan 24, 2025
1 parent baba014 commit 9f0daaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rmk/src/combo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Combo {
let action_idx = self.actions.iter().position(|&a| a == key_action);
if let Some(i) = action_idx {
self.state |= 1 << i;
} else {
} else if !self.done() {
self.reset();
}
action_idx.is_some()
Expand Down
2 changes: 2 additions & 0 deletions rmk/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,12 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize>
while let Some((action, event)) = self.combo_actions_buffer.pop_front() {
self.process_key_action(action, event).await;
}

self.keymap
.borrow_mut()
.combos
.iter_mut()
.filter(|combo| !combo.done())
.for_each(Combo::reset);
}

Expand Down

0 comments on commit 9f0daaa

Please sign in to comment.