kbdfs: ignoring fake shifts
This commit is contained in:
parent
612d666d54
commit
11e38d21c8
1 changed files with 20 additions and 18 deletions
|
@ -164,7 +164,7 @@ Rune kbtabesc1[Nscan] =
|
||||||
[0x10] 0, 0, 0, 0, 0, 0, 0, 0,
|
[0x10] 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
[0x18] 0, 0, 0, 0, '\n', Kctl, 0, 0,
|
[0x18] 0, 0, 0, 0, '\n', Kctl, 0, 0,
|
||||||
[0x20] 0, 0, 0, 0, 0, 0, 0, 0,
|
[0x20] 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
[0x28] 0, 0, Kshift, 0, 0, 0, 0, 0,
|
[0x28] 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
[0x30] 0, 0, 0, 0, 0, '/', 0, Kprint,
|
[0x30] 0, 0, 0, 0, 0, '/', 0, Kprint,
|
||||||
[0x38] Kaltgr, 0, 0, 0, 0, 0, 0, 0,
|
[0x38] Kaltgr, 0, 0, 0, 0, 0, 0, 0,
|
||||||
[0x40] 0, 0, 0, 0, 0, 0, Kbreak, Khome,
|
[0x40] 0, 0, 0, 0, 0, 0, Kbreak, Khome,
|
||||||
|
@ -228,15 +228,18 @@ kbdputsc(Scan *scan, int c)
|
||||||
Key key;
|
Key key;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* e0's is the first of a 2 character sequence, e1 the first
|
* e0's is the first of a 2 character sequence, e1 and e2 the first
|
||||||
* of a 3 character sequence (on the safari)
|
* of a 3 character sequence (on the safari)
|
||||||
*/
|
*/
|
||||||
if(c == 0xe0){
|
if(scan->esc2){
|
||||||
scan->esc1 = 1;
|
scan->esc2--;
|
||||||
return;
|
return;
|
||||||
} else if(c == 0xe1){
|
} else if(c == 0xe1 || c == 0xe2){
|
||||||
scan->esc2 = 2;
|
scan->esc2 = 2;
|
||||||
return;
|
return;
|
||||||
|
} else if(c == 0xe0){
|
||||||
|
scan->esc1 = 1;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
key.down = (c & 0x80) == 0;
|
key.down = (c & 0x80) == 0;
|
||||||
|
@ -268,7 +271,7 @@ kbdputsc(Scan *scan, int c)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scan->esc1)
|
if(scan->esc1 || kbtab[c] == 0)
|
||||||
key.b = key.r;
|
key.b = key.r;
|
||||||
else
|
else
|
||||||
key.b = kbtab[c];
|
key.b = kbtab[c];
|
||||||
|
@ -279,13 +282,9 @@ kbdputsc(Scan *scan, int c)
|
||||||
if(scan->ctl && scan->alt && key.r == Kdel)
|
if(scan->ctl && scan->alt && key.r == Kdel)
|
||||||
reboot();
|
reboot();
|
||||||
|
|
||||||
|
if(key.b)
|
||||||
send(keychan, &key);
|
send(keychan, &key);
|
||||||
|
|
||||||
if(scan->esc1)
|
|
||||||
scan->esc1 = 0;
|
|
||||||
else if(scan->esc2)
|
|
||||||
scan->esc2--;
|
|
||||||
|
|
||||||
switch(key.r){
|
switch(key.r){
|
||||||
case Kshift:
|
case Kshift:
|
||||||
scan->shift = key.down;
|
scan->shift = key.down;
|
||||||
|
@ -306,6 +305,7 @@ kbdputsc(Scan *scan, int c)
|
||||||
scan->caps ^= key.down;
|
scan->caps ^= key.down;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
scan->esc1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1155,6 +1155,7 @@ fswrite(Req *r)
|
||||||
*/
|
*/
|
||||||
for(i=0; i<Nscan; i++){
|
for(i=0; i<Nscan; i++){
|
||||||
if((a->shift && kbtabshift[i] == k.r) || (kbtab[i] == k.r)){
|
if((a->shift && kbtabshift[i] == k.r) || (kbtab[i] == k.r)){
|
||||||
|
if(kbtab[i])
|
||||||
k.b = kbtab[i];
|
k.b = kbtab[i];
|
||||||
if(a->shift)
|
if(a->shift)
|
||||||
k.r = kbtabshift[i];
|
k.r = kbtabshift[i];
|
||||||
|
@ -1165,6 +1166,7 @@ fswrite(Req *r)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(k.b)
|
||||||
send(keychan, &k);
|
send(keychan, &k);
|
||||||
if(k.r == Kshift)
|
if(k.r == Kshift)
|
||||||
a->shift = k.down;
|
a->shift = k.down;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue