aboutsummaryrefslogtreecommitdiff
path: root/src/edbox.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-21 04:56:41 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-21 04:56:41 -0400
commitab2c13a26d23e336fca881e1375235aff4f2dc5e (patch)
tree733ad874f7c3baefcca658d3a5611f2e6cfd9f75 /src/edbox.c
parent7c0d10714404d0ae82b3c570f0c9e44d0faeb565 (diff)
downloadfujinet-chat-ab2c13a26d23e336fca881e1375235aff4f2dc5e.tar.gz
Control and numbers 1-7 switch screens.
Diffstat (limited to 'src/edbox.c')
-rw-r--r--src/edbox.c40
1 files changed, 27 insertions, 13 deletions
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;
}