aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-16 01:11:40 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-16 01:11:40 -0400
commit6d6c44d74e113ace4709f037316a2ec80753aa3a (patch)
treeb5e8717be09cb3d0fb227cc5e7beef7cd9b88851
parent7f84b8b95bf28186f8cbf7bd4b307e37abb96ad2 (diff)
downloadfujinet-chat-6d6c44d74e113ace4709f037316a2ec80753aa3a.tar.gz
Filter out ctrl+shift combos, except the up/down arrows which we actually use.
-rw-r--r--src/edbox.c19
1 files 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;