aboutsummaryrefslogtreecommitdiff
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
parent7c0d10714404d0ae82b3c570f0c9e44d0faeb565 (diff)
downloadfujinet-chat-ab2c13a26d23e336fca881e1375235aff4f2dc5e.tar.gz
Control and numbers 1-7 switch screens.
-rw-r--r--TODO7
-rw-r--r--src/edbox.c40
-rw-r--r--src/irc.c8
3 files changed, 36 insertions, 19 deletions
diff --git a/TODO b/TODO
index 2e52b4e..77797d9 100644
--- a/TODO
+++ b/TODO
@@ -12,9 +12,10 @@ FujiChat features, we're almost at parity!
Other stuff:
-- Make control + 1 through 7 switch windows (same as Start), because
- the XEGS and 1200XL Start keys are hard to reach while typing (brad
- and MarkG).
+- Write a cgetc() replacement that doesn't call the OS K: "get one byte"
+ routine. I was avoiding it because it will need a 192-byte table
+ (keycode -> atascii lookup)... but I'm spending more than 192 bytes
+ of code on keycode-filtering, and it's not even complete.
- Filter out the rest of the keystrokes that causes cgetc() to block.
Includes ctrl-/, ctrl-8, ctrl-9, maybe others (The_Doctor__).
- Stop using ASCII translation on the FujiNet. It's turning a outgoing
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;
}
diff --git a/src/irc.c b/src/irc.c
index 91784b7..137e66c 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -919,13 +919,15 @@ static void toggle_edbox_only(void) {
OS.sdlst = edbox_only_dlist;
}
-static void start_keystroke(void) {
+void start_keystroke(void) {
char i, s;
i = cgetc();
- start_latch = 0;
- if(i == CH_ESC) return;
+ start_latch = OS.escflg = OS.invflg = 0;
+ if(i == CH_ESC) {
+ return;
+ }
if(i >= '1' && i <= '7') {
s = i - '1';