From ab2c13a26d23e336fca881e1375235aff4f2dc5e Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 21 Mar 2026 04:56:41 -0400 Subject: Control and numbers 1-7 switch screens. --- src/edbox.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'src/edbox.c') diff --git a/src/edbox.c b/src/edbox.c index b7287e5..beb25be 100644 --- a/src/edbox.c +++ b/src/edbox.c @@ -243,8 +243,10 @@ static void normal_keystroke(void) { void edbox_keystroke(void) { extern char start_latch; + extern void start_keystroke(void); char c; + if(OS.ssflag) OS.ch = 0x9f; while(OS.ch == 0xff) ; @@ -261,10 +263,34 @@ void edbox_keystroke(void) { return; } + /* keys we want to ignore or act on without showing the edbox */ + switch(OS.ch) { + case 0x1c: /* key: ESC */ + keyclick(); + start_latch = 1; + return; + case 0x9f: /* ctrl-1 (XXX: the OS traps this, we never see it!) */ + case 0x9e: /* ctrl-2 */ + case 0x9a: /* ctrl-3 (crash if cgetc() reads it!) */ + case 0x98: /* ctrl-4 */ + case 0x9d: /* ctrl-5 */ + case 0x9b: /* ctrl-6 */ + case 0xb3: /* ctrl-7 */ + OS.ch &= 0x7f; + start_latch = 1; + start_keystroke(); + return; + case 0x6c: /* shift-tab */ + case 0xac: /* ctrl-tab */ + OS.ch = 0xff; /* ignore it! */ + return; + break; + } + edbox_show(); + /* keys we want to act on, and show the edbox after */ c = 0; - switch(OS.ch) { case 0xa0: /* key: ctrl [ */ c = 0x7b; /* ascii: { */ @@ -272,11 +298,6 @@ void edbox_keystroke(void) { case 0xa2: /* key: ctrl ] */ c = 0x7d; /* ascii: } */ break; - case 0x1c: /* key: ESC */ - keyclick(); - if(!edbox_len) edbox_hide(); - start_latch = 1; - return; break; case 0x5c: /* key: shift ESC */ c = 0x60; /* ascii: ` */ @@ -296,13 +317,6 @@ void edbox_keystroke(void) { case 0xa7: /* ...w/ctrl */ c = 0x02; /* ^B = IRC bold formatting char */ break; - case 0x9a: /* ctrl-3 (crash if cgetc() reads it!) */ - case 0x9e: /* ctrl-2 */ - case 0x6c: /* shift-tab */ - case 0xac: /* ctrl-tab */ - OS.ch = 0xff; /* ignore it! */ - return; - break; default: break; } -- cgit v1.2.3