From 6d6c44d74e113ace4709f037316a2ec80753aa3a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 16 Mar 2026 01:11:40 -0400 Subject: Filter out ctrl+shift combos, except the up/down arrows which we actually use. --- src/edbox.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/edbox.c b/src/edbox.c index b70ae2a..de9df79 100644 --- a/src/edbox.c +++ b/src/edbox.c @@ -198,6 +198,19 @@ void edbox_keystroke(void) { while(OS.ch == 0xff) ; + /* filter out all ctrl-shift key combos except the ones + we actually support */ + if(OS.ch == 0xce) { + /* ctrl-shift-up, same as ^B = back 1 word */ + OS.ch = 0x95; + } else if(OS.ch == 0xcf) { + /* ctrl-shift-down, same as ^F = forward 1 word */ + OS.ch = 0xb8; + } else if(OS.ch > 0xbf) { + OS.ch = 0xff; + return; + } + edbox_show(); c = 0; @@ -229,12 +242,6 @@ void edbox_keystroke(void) { case 0xa7: /* ...w/ctrl */ c = 0x02; /* ^B = IRC bold formatting char */ break; - case 0xce: /* ctrl-shift-up, same as... */ - OS.ch = 0x95; /* ^B = back 1 word */ - break; - case 0xcf: /* ctrl-shift-down, same as... */ - OS.ch = 0xb8; /* ^F = forward 1 word */ - break; case 0x9a: /* ctrl-3 (crash if cgetc() reads it!) */ OS.ch = 0xff; /* ignore it! */ return; -- cgit v1.2.3