Skip to content

Commit

Permalink
tapping while taphold release self after other press
Browse files Browse the repository at this point in the history
  • Loading branch information
hitsmaxft committed Mar 10, 2025
1 parent 58e3485 commit d2d367b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions rmk/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,22 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize>
// Wait for key release, record all pressed keys during this
loop {
let next_key_event = KEY_EVENT_CHANNEL.receive().await;
self.unprocessed_events.push(next_key_event).ok();
if !next_key_event.pressed {
break;

// check self release for rolling keys
if next_key_event.row == key_event.row && next_key_event.col == key_event.col {
// release self before hold timeout, trigger tap
self.process_key_action_tap(tap_action, key_event).await;
// clean timer
self.timer[col][row] = None;
return;
} else {
self.unprocessed_events.push(next_key_event).ok();
// release other key , trigger hold
break;
}
} else {
self.unprocessed_events.push(next_key_event).ok();
}
}

Expand Down

0 comments on commit d2d367b

Please sign in to comment.