diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-08 14:32:28 +0100 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-08 14:32:28 +0100 |
commit | b1da2bb10b9ea941aeee2dfcb5ac1540e9169770 (patch) | |
tree | bd8977032aaa2c59415d67511c00438299f9ee56 | |
parent | 93c6f8cb0dbd4386aea73773933d917848922a1b (diff) | |
download | plan9front-b1da2bb10b9ea941aeee2dfcb5ac1540e9169770.tar.xz |
vncv: do NOT map Kaltgr to meta, introduce Mod4 (Super) as an extra key to use instead
-rw-r--r-- | sys/src/cmd/vnc/kbdv.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/src/cmd/vnc/kbdv.c b/sys/src/cmd/vnc/kbdv.c index 967843b0c..4da3eafa5 100644 --- a/sys/src/cmd/vnc/kbdv.c +++ b/sys/src/cmd/vnc/kbdv.c @@ -6,7 +6,8 @@ enum { Xshift = 0xFFE1, Xctl = 0xFFE3, Xmeta = 0xFFE7, - Xalt = 0xFFE9 + Xalt = 0xFFE9, + Xsuper = 0xFFEB, }; static struct { @@ -41,10 +42,11 @@ static struct { {KF|10, 0xffc7}, {KF|11, 0xffc8}, {KF|12, 0xffc9}, + {Kaltgr, 0xfe03}, {Kshift, Xshift}, {Kalt, Xalt}, - {Kaltgr, Xmeta}, + {Kmod4, Xsuper}, {Kctl, Xctl}, }; @@ -95,7 +97,7 @@ readcons(Vnc *v) { char buf[256], k[10]; ulong ks; - int ctlfd, fd, kr, kn, w, shift, ctl, alt; + int ctlfd, fd, kr, kn, w, shift, ctl, alt, mod4; Rune r; snprint(buf, sizeof buf, "%s/cons", display->devdir); @@ -108,7 +110,7 @@ readcons(Vnc *v) write(ctlfd, "rawon", 5); kn = 0; - shift = alt = ctl = 0; + shift = alt = ctl = mod4 = 0; for(;;){ while(!fullrune(k, kn)){ kr = read(fd, k+kn, sizeof k - kn); @@ -134,6 +136,10 @@ readcons(Vnc *v) shift = !shift; keyevent(v, Xshift, shift); break; + case Kmod4: + mod4 = !mod4; + keyevent(v, Xsuper, alt); + break; default: if(r == ks && r < 0x1A){ /* control key */ keyevent(v, Xctl, 1); @@ -176,6 +182,10 @@ readcons(Vnc *v) keyevent(v, Xshift, 0); shift = 0; } + if(mod4){ + keyevent(v, Xsuper, 0); + shift = 0; + } break; } } @@ -228,7 +238,7 @@ readkbd(Vnc *v) if((r == Kshift) || utfrune(buf+1, Kctl) || utfrune(buf+1, Kalt) || - utfrune(buf+1, Kaltgr)) + utfrune(buf+1, Kmod4)) keyevent(v, runetovnc(r), 1); } break; @@ -241,7 +251,7 @@ readkbd(Vnc *v) } break; case 'c': - if(utfrune(buf2+1, Kctl) || utfrune(buf2+1, Kalt) || utfrune(buf2+1, Kaltgr)) + if(utfrune(buf2+1, Kctl) || utfrune(buf2+1, Kalt) || utfrune(buf2+1, Kmod4)) continue; chartorune(&r, buf+1); keyevent(v, runetovnc(r), 1); |