aboutsummaryrefslogtreecommitdiff
path: root/src/input/encode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/encode.rs')
-rw-r--r--src/input/encode.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/input/encode.rs b/src/input/encode.rs
index 8ec8a1c5..774ab1a6 100644
--- a/src/input/encode.rs
+++ b/src/input/encode.rs
@@ -16,7 +16,10 @@ pub fn encode_key(key: KeyEvent, protocol: KeyboardProtocol) -> Vec<u8> {
}
pub fn encode_terminal_key(key: TerminalKey, protocol: KeyboardProtocol) -> Vec<u8> {
- if key.kind != crossterm::event::KeyEventKind::Release {
+ // REPORT_ALL_KEYS must retain physical press/repeat/release semantics instead of
+ // reducing a native key to its layout-generated text.
+ let preserve_physical_key = key.has_physical_identity() && protocol.reports_all_keys();
+ if !preserve_physical_key && key.kind != crossterm::event::KeyEventKind::Release {
if let Some(text) = &key.generated_text {
return text.as_bytes().to_vec();
}