vncv: allow the use of the Mod4 (Super) key
This commit is contained in:
parent
f84cf1e604
commit
061ec57021
1 changed files with 18 additions and 4 deletions
|
@ -6,7 +6,8 @@ enum {
|
||||||
Xshift = 0xFFE1,
|
Xshift = 0xFFE1,
|
||||||
Xctl = 0xFFE3,
|
Xctl = 0xFFE3,
|
||||||
Xmeta = 0xFFE7,
|
Xmeta = 0xFFE7,
|
||||||
Xalt = 0xFFE9
|
Xalt = 0xFFE9,
|
||||||
|
Xsuper = 0xFFEB,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
|
@ -45,6 +46,7 @@ static struct {
|
||||||
{Kshift, Xshift},
|
{Kshift, Xshift},
|
||||||
{Kalt, Xalt},
|
{Kalt, Xalt},
|
||||||
{Kaltgr, Xmeta},
|
{Kaltgr, Xmeta},
|
||||||
|
{Kmod4, Xsuper},
|
||||||
{Kctl, Xctl},
|
{Kctl, Xctl},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,7 +97,7 @@ readcons(Vnc *v)
|
||||||
{
|
{
|
||||||
char buf[256], k[10];
|
char buf[256], k[10];
|
||||||
ulong ks;
|
ulong ks;
|
||||||
int ctlfd, fd, kr, kn, w, shift, ctl, alt;
|
int ctlfd, fd, kr, kn, w, shift, ctl, alt, super;
|
||||||
Rune r;
|
Rune r;
|
||||||
|
|
||||||
snprint(buf, sizeof buf, "%s/cons", display->devdir);
|
snprint(buf, sizeof buf, "%s/cons", display->devdir);
|
||||||
|
@ -108,7 +110,7 @@ readcons(Vnc *v)
|
||||||
write(ctlfd, "rawon", 5);
|
write(ctlfd, "rawon", 5);
|
||||||
|
|
||||||
kn = 0;
|
kn = 0;
|
||||||
shift = alt = ctl = 0;
|
shift = alt = ctl = super = 0;
|
||||||
for(;;){
|
for(;;){
|
||||||
while(!fullrune(k, kn)){
|
while(!fullrune(k, kn)){
|
||||||
kr = read(fd, k+kn, sizeof k - kn);
|
kr = read(fd, k+kn, sizeof k - kn);
|
||||||
|
@ -134,6 +136,10 @@ readcons(Vnc *v)
|
||||||
shift = !shift;
|
shift = !shift;
|
||||||
keyevent(v, Xshift, shift);
|
keyevent(v, Xshift, shift);
|
||||||
break;
|
break;
|
||||||
|
case Kmod4:
|
||||||
|
super = !super;
|
||||||
|
keyevent(v, Xsuper, super);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if(r == ks && r < 0x1A){ /* control key */
|
if(r == ks && r < 0x1A){ /* control key */
|
||||||
keyevent(v, Xctl, 1);
|
keyevent(v, Xctl, 1);
|
||||||
|
@ -176,6 +182,10 @@ readcons(Vnc *v)
|
||||||
keyevent(v, Xshift, 0);
|
keyevent(v, Xshift, 0);
|
||||||
shift = 0;
|
shift = 0;
|
||||||
}
|
}
|
||||||
|
if(super){
|
||||||
|
keyevent(v, Xsuper, 0);
|
||||||
|
super = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,6 +238,7 @@ readkbd(Vnc *v)
|
||||||
if((r == Kshift) ||
|
if((r == Kshift) ||
|
||||||
utfrune(buf+1, Kctl) ||
|
utfrune(buf+1, Kctl) ||
|
||||||
utfrune(buf+1, Kalt) ||
|
utfrune(buf+1, Kalt) ||
|
||||||
|
utfrune(buf+1, Kmod4) ||
|
||||||
utfrune(buf+1, Kaltgr))
|
utfrune(buf+1, Kaltgr))
|
||||||
keyevent(v, runetovnc(r), 1);
|
keyevent(v, runetovnc(r), 1);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +252,10 @@ readkbd(Vnc *v)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'c':
|
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) ||
|
||||||
|
utfrune(buf2+1, Kaltgr))
|
||||||
continue;
|
continue;
|
||||||
chartorune(&r, buf+1);
|
chartorune(&r, buf+1);
|
||||||
keyevent(v, runetovnc(r), 1);
|
keyevent(v, runetovnc(r), 1);
|
||||||
|
|
Loading…
Reference in a new issue