Unset Shift and Ctrl for arrow keys (closes #1015)

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2026-07-06 00:22:51 +02:00
parent e0c287306e
commit 102d1c9a9b
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -167,6 +167,12 @@ pub fn getKeyList(allocator: Allocator, tb_event: termbox.tb_event) !KeyList {
21 => key.right = true,
else => {},
}
if (code >= 18 and code <= 21) {
// https://github.com/termbox/termbox2/blob/605398fa79108412976191e062ea14bd4bd30213/termbox2.h#L446
key.ctrl = false;
key.shift = false;
}
} else if (tb_event.ch < 128) {
const code = if (tb_event.ch == 0 and tb_event.key < 128) tb_event.key else tb_event.ch;