Skip to content

Commit

Permalink
Stopped trying to handle key events when a modifier other than shift …
Browse files Browse the repository at this point in the history
…is pressed. Resolves #7
  • Loading branch information
nick42d committed Dec 4, 2023
1 parent 30fe72b commit c72b80c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/component/actionhandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ pub trait TextHandler {
if !self.is_text_handling() {
return false;
}
// The only accepted modifier is shift - if pressing another set of modifiers, we won't handle it.
// Somewhere else should instead.
if !key_event.modifiers.is_empty() {
if key_event.modifiers != KeyModifiers::SHIFT {
return false;
}
}
match key_event.code {
KeyCode::Char(c) => {
self.push_text(c);
Expand Down

0 comments on commit c72b80c

Please sign in to comment.