summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-27 00:41:58 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-27 00:41:58 +0000
commitc266a31572cdd704a5f9e9092e9447106e19d92c (patch)
tree8dbbfa88ae20034b114c7744929dd265d5de3f34
parentf9f94d0b52d867042ec57ef574cbe7c5221ed652 (diff)
downloadplan9front-c266a31572cdd704a5f9e9092e9447106e19d92c.tar.xz
kbdfs: disable console processing if /dev/kbd is open
-rw-r--r--sys/man/8/kbdfs6
-rw-r--r--sys/src/cmd/aux/kbdfs.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/man/8/kbdfs b/sys/man/8/kbdfs
index 7dc206afc..7149cbd62 100644
--- a/sys/man/8/kbdfs
+++ b/sys/man/8/kbdfs
@@ -171,7 +171,11 @@ or
.B Num
will not change
the characters already present in the string, but will
-take effect on newly pressed keys.
+take effect on newly pressed keys. Opening the
+.BR kbd
+file disables input processing on the
+.BR cons
+file until it is closed again.
.PP
Raw scancodes can be written to the
.BR kbin
diff --git a/sys/src/cmd/aux/kbdfs.c b/sys/src/cmd/aux/kbdfs.c
index c9eed2c07..1a0a0fa3d 100644
--- a/sys/src/cmd/aux/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs.c
@@ -605,7 +605,7 @@ ctlproc(void *)
break;
case Araw:
- if(raw){
+ if(raw || kbdopen){
s = emalloc9p(UTFmax+1);
s[runetochar(s, &r)] = 0;
} else {
@@ -620,6 +620,11 @@ ctlproc(void *)
e = s + strlen(s);
Havereq:
+ if(kbdopen){
+ free(b);
+ b = nil;
+ break;
+ }
while(b && (req = qcons.h)){
if((qcons.h = req->aux) == nil)
qcons.t = &qcons.h;