summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-07-16 23:36:40 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2021-07-16 23:36:40 +0000
commitfad1b3f7f77f08764f0e32f8ce18bee16da3aa69 (patch)
tree543c0a5d21211149fa420fb58c2cb6808de76d07
parente85aa1089d1d4954aa949cd05c5b6b9c3fca596c (diff)
downloadplan9front-fad1b3f7f77f08764f0e32f8ce18bee16da3aa69.tar.xz
kbdfs: allow to escape ctlr-alt-del with shift for vmx and vnc.
-rw-r--r--sys/man/8/kbdfs26
-rw-r--r--sys/src/cmd/aux/kbdfs/kbdfs.c15
2 files changed, 39 insertions, 2 deletions
diff --git a/sys/man/8/kbdfs b/sys/man/8/kbdfs
index 20619dfa7..93e0a2e61 100644
--- a/sys/man/8/kbdfs
+++ b/sys/man/8/kbdfs
@@ -179,6 +179,32 @@ This is used to provide a serial console when
.B $console
environment variable is set. (see
.IR plan9.ini (8)).
+.PP
+Holding
+.LR Ctrl
++
+.LR Alt
+and then pressing the
+.LR Del
+key will
+trigger a reboot of the terminal.
+To forward this sequence downstream,
+.LR Shift
++
+.LR Ctrl
++
+.LR Alt
+and then pressing
+.LR Del
+will cause to send a
+.LR Shift
+up before the
+.LR Del
+key.
+This is usefull for programs like
+.IR vnc (1)
+and
+.IR vmx (1).
.SS Keyboard
A read on the
.BR kbd
diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c
index d23152034..3d64e1564 100644
--- a/sys/src/cmd/aux/kbdfs/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c
@@ -371,6 +371,13 @@ shutdown(void)
threadexitsall(nil);
}
+void
+shiftup(void)
+{
+ Key key = { .down = 0, .r = Kshift, .b = Kshift };
+ send(keychan, &key);
+}
+
/*
* Scan code processing
*/
@@ -433,8 +440,12 @@ kbdputsc(Scan *scan, int c)
if(scan->caps && key.r<='z' && key.r>='a')
key.r += 'A' - 'a';
- if(scan->ctl && scan->alt && key.r == Kdel)
- reboot();
+ if(scan->ctl && scan->alt && key.r == Kdel){
+ if(scan->shift)
+ shiftup();
+ else
+ reboot();
+ }
if(key.b)
send(keychan, &key);