Skip to content

Commit

Permalink
fix!(seq): release keys in valid visible-backspaced sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroo committed Nov 4, 2023
1 parent 36be5b2 commit 7c12d7b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/kanata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,16 @@ impl Kanata {
SequenceInputMode::HiddenSuppressed
| SequenceInputMode::HiddenDelayType => {}
SequenceInputMode::VisibleBackspaced => {
// Release all keys since they might modify the behaviour of
// backspace into an undesirable behaviour, for example deleting
// more characters than it should.
layout.states.retain(|s| match s {
State::NormalKey { keycode, .. } => {
let _ = self.kbd_out.release_key(keycode.into());
false
}
_ => true,
});
for k in state.sequence.iter() {
// Check for pressed modifiers and don't input backspaces for
// those since they don't output characters that can be
Expand Down

0 comments on commit 7c12d7b

Please sign in to comment.