| plan 9 kernel history: overview | file list | diff list |
1991/1211/ss/screen.c (diff list | history)
| 1991/1108/sys/src/9/ss/screen.c:244,309 – 1991/1211/sys/src/9/ss/screen.c:244,327 (short | long | prev | next) | ||
| 1990/1231 | static caps = 0; static long startclick; | |
| 1991/0713 | static int repeatc; | |
| 1991/0112 |
| |
| 1990/1231 |
| |
| 1991/1211 | static int lstate; static uchar kc[4]; uchar ch, code; int i, nk; | |
| 1990/1231 |
| |
| 1991/1211 | ch = kbdmap[shift][c&0x7F]; | |
| 1990/1231 | if(c==0x7F){ /* all keys up */ | |
| 1991/0713 | norepeat: kbdrepeat(0); | |
| 1990/1231 | return; } | |
| 1991/1211 | if(ch == 0xFF) /* shouldn't happen; ignore */ | |
| 1990/1231 | return; if(c & 0x80){ /* key went up */ | |
| 1991/1211 | if(ch == 0xF0){ /* control */ | |
| 1990/1231 | shift &= ~2; | |
| 1991/0713 | goto norepeat; | |
| 1990/1223 | } | |
| 1990/1231 |
| |
| 1991/1211 | if(ch == 0xF1){ /* shift */ | |
| 1990/1231 | shift &= ~1; | |
| 1991/0713 | goto norepeat; | |
| 1990/1231 | } | |
| 1991/1211 | if(ch == 0xF2){ /* caps */ | |
| 1991/0713 | goto norepeat; | |
| 1990/1231 | } | |
| 1991/0713 | goto norepeat; | |
| 1990/1223 | } | |
| 1990/1231 |
| |
| 1991/1211 | if(ch == 0xF0){ /* control */ | |
| 1990/1231 | shift |= 2; | |
| 1991/0713 | goto norepeat; | |
| 1990/1223 | } | |
| 1990/1231 |
| |
| 1991/1211 | if(ch==0xF1){ /* shift */ | |
| 1990/1231 | shift |= 1; | |
| 1991/0713 | goto norepeat; | |
| 1990/1231 | } | |
| 1991/1211 | if(ch==0xF2){ /* caps */ | |
| 1990/1231 | caps ^= 1; | |
| 1991/0713 | goto norepeat; | |
| 1990/1231 | } | |
| 1991/1211 | if(caps && 'a'<=ch && ch<='z') ch |= ' '; repeatc = ch; | |
| 1991/0713 | kbdrepeat(1); | |
| 1991/0112 |
| |
| 1991/1211 | if(ch == 0xB6) /* Compose */ lstate = 1; | |
| 1991/0112 | else{ | |
| 1991/1211 | switch(lstate){ | |
| 1991/0112 | case 1: | |
| 1991/1211 | kc[0] = ch; lstate = 2; if(ch == 'X') lstate = 3; | |
| 1991/0112 | break; case 2: | |
| 1991/0604 |
| |
| 1991/0112 |
| |
| 1991/1211 | kc[1] = ch; c = latin1(kc); nk = 2; putit: lstate = 0; if(c != -1) kbdputc(&kbdq, c); else for(i=0; i<nk; i++) kbdputc(&kbdq, kc[i]); break; case 3: case 4: case 5: kc[lstate-2] = ch; lstate++; break; case 6: kc[4] = ch; c = unicode(kc); nk = 5; goto putit; | |
| 1991/0112 | default: | |
| 1991/0604 |
| |
| 1991/1211 | kbdputc(&kbdq, ch); break; | |
| 1991/0112 | } } | |
| 1991/0604 | } | |