diff options
| author | Aram Drevekenin <aram@poor.dev> | 2021-05-13 17:15:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-13 17:15:13 +0200 |
| commit | 8cdc7fbb6922bc1ae22b05c5a7d4f731d376249a (patch) | |
| tree | c2cb65cfcb1799295dfbc6edec92e7c75b02b6b5 /src | |
| parent | fix(compatibility): implement device reports (#500) (diff) | |
| download | sl0ppij-8cdc7fbb6922bc1ae22b05c5a7d4f731d376249a.tar.gz sl0ppij-8cdc7fbb6922bc1ae22b05c5a7d4f731d376249a.tar.xz sl0ppij-8cdc7fbb6922bc1ae22b05c5a7d4f731d376249a.zip | |
fix(input): forward unknown keys to active terminal (#501)
* fix(input): forward unknown keys to active terminal
* docs(changelog): update change
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/input/handler.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs index 2dbec080..b2f4d0a3 100644 --- a/src/common/input/handler.rs +++ b/src/common/input/handler.rs @@ -75,6 +75,10 @@ impl InputHandler { self.pasting = true; } else if unsupported_key == bracketed_paste_end { self.pasting = false; + } else { + // this is a hack because termion doesn't recognize certain keys + // in this case we just forward it to the terminal + self.handle_unknown_key(raw_bytes); } } termion::event::Event::Mouse(_) => { @@ -87,6 +91,12 @@ impl InputHandler { } } } + fn handle_unknown_key(&mut self, raw_bytes: Vec<u8>) { + if self.mode == InputMode::Normal || self.mode == InputMode::Locked { + let action = Action::Write(raw_bytes); + self.dispatch_action(action); + } + } fn handle_key(&mut self, key: &Key, raw_bytes: Vec<u8>) { let keybinds = &self.config.keybinds; if self.pasting { |
