summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio/dat.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2023-02-06 19:04:15 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2023-02-06 19:04:15 +0000
commite982ca2f8d6779b6b103a0d812d61f88f2338294 (patch)
tree6b4068449f2c5ea93ce8e1a02c4bfd7bc87d07a8 /sys/src/cmd/rio/dat.h
parent32acb3ebd8ecb684a4db054febc082b99d5957be (diff)
rio: refactor the keyboardtap code a bit
run the keyboardtap as a thread instead of a proc so that we can read input window variable. This gets rid of the wintap channel. do focus handling by tracking the last window and only send context switch when we start typing into a different window. have fromtap, totap channels created by open and use the variable also as the in-use flag. handle use nbsendp() when sending to the tap program, as it might be blocked or misbehaving. if the totap channel is full, we bypass the tap and send to input again. handle keyup on focus loss in the window thread instead (just like the artificial mouseup) it is unrelated to keyboardtap.
Diffstat (limited to 'sys/src/cmd/rio/dat.h')
-rw-r--r--sys/src/cmd/rio/dat.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/src/cmd/rio/dat.h b/sys/src/cmd/rio/dat.h
index d9cb1432e..498bccdc9 100644
--- a/sys/src/cmd/rio/dat.h
+++ b/sys/src/cmd/rio/dat.h
@@ -172,6 +172,7 @@ struct Window
uchar deleted;
uchar mouseopen;
uchar kbdopen;
+ uchar keyup;
uchar winnameread;
char *label;
char *dir;
@@ -315,16 +316,10 @@ int snarffd;
int gotscreen;
int servekbd;
-enum{
- Tapon = 'b',
- Tapoff = 'e',
- Tapfocus = 'z',
-};
-Channel *ctltap; /* open/close */
-Channel *resptap; /* open/close err */
-Channel *fromtap; /* input from kbd tap program to window */
+Channel *opentap; /* open fromtap or totap */
+Channel *closetap; /* close fromtap or totap */
+Channel *fromtap; /* keyboard output from the tap program */
Channel *totap; /* our keyboard input to tap program */
-Channel *wintap; /* tell the tapthread which Window to send to */
Window *input;
QLock all; /* BUG */