summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-05-28 16:34:14 +0000
committercinap_lenrek <cinap_lenrek@centraldogma>2011-05-28 16:34:14 +0000
commit4c93f534ac515a3e553bf65aaa2ee47b8588e1e3 (patch)
tree75b53a02fe8f0a49faeaf3931f036355b4c38e12 /sys
parent64f14cc6a4a5d0200f56d88c843bb439dcc473d9 (diff)
kbdfs: ignore compose sequence if ctl was pressed
Diffstat (limited to 'sys')
-rw-r--r--sys/src/cmd/aux/kbdfs/kbdfs.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c
index 2da4f958f..9932f8dae 100644
--- a/sys/src/cmd/aux/kbdfs/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c
@@ -441,13 +441,13 @@ nextrune(Channel *ch, Rune *r)
case Kcaps:
case Knum:
case Kshift:
- case Kctl:
case Kaltgr:
- /* ignore these special keys */
+ /* ignore modifiers */
continue;
+ case Kctl:
case Kalt:
- /* latin escape! */
+ /* composing escapes */
return 1;
}
return 0;
@@ -463,25 +463,40 @@ void
runeproc(void *)
{
static struct {
- char *ld; /* must be seen before using this conversion */
- char *si; /* options for last input characters */
- Rune *so; /* the corresponding Rune for each si entry */
+ char *ld; /* must be seen before using this conversion */
+ char *si; /* options for last input characters */
+ Rune *so; /* the corresponding Rune for each si entry */
} tab[] = {
#include "latin1.h"
};
Rune r, rr;
int i, j;
+ int ctl;
threadsetname("runeproc");
+ ctl = 0;
while((i = nextrune(rawchan, &r)) >= 0){
if(i == 0){
+ ctl = 0;
Forward:
send(runechan, &r);
continue;
}
- /* latin sequence */
+ if(r == Kctl){
+ ctl = 1;
+ continue;
+ }
+
+ /*
+ * emulators like qemu and vmware use Ctrl+Alt to lock
+ * keyboard input so dont confuse them for a compose
+ * sequence.
+ */
+ if(r != Kalt || ctl)
+ continue;
+
if(nextrune(rawchan, &r))
continue;
@@ -500,7 +515,7 @@ Forward:
else
break;
}
- if(i == 4 && r > 0)
+ if(i == 4 && r)
goto Forward;
} else {
if(nextrune(rawchan, &rr))