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 53e1ddd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/kanata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,18 @@ 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, .. } => {
// Ignore the error, ugly to return it from retain, and
// this is very unlikely to happen anyway.
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 53e1ddd

Please sign in to comment.