Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1085 pj 1
//#include <string.h>
2
//#include <stdlib.h>
3
//#include <cons.h>
4
 
5
 
6
#include <kernel/kern.h>
7
#include <drivers/keyb.h>
8
 
9
int main(int argc, char **argv)
10
{
11
    KEY_EVT k;
12
    clear();
13
    k.ascii = 0;
14
    while (k.ascii != ESC) {
15
        keyb_getcode(&k,BLOCK);
16
        if (k.ascii == '2') {
17
            keyb_set_map(itaMap);
18
            cprintf("\nItalian Keymap set\n");
19
        }
20
        if (k.ascii == '3') {
21
            keyb_set_map(engMap);
22
            cprintf("\nEnglish Keymap set\n");
23
        }
24
        if (isLeftCtrl(k)) putc_xy(72+0,0,RED,'L');
25
        else putc_xy(72+0,0,RED,' ');
26
        if (isRightCtrl(k)) putc_xy(72+1,0,RED,'R');
27
        else putc_xy(72+1,0,RED,' ');
28
        if (isLeftAlt(k)) putc_xy(72+2,0,GREEN,'L');
29
        else putc_xy(72+2,0,RED,' ');
30
        if (isRightAlt(k)) putc_xy(72+3,0,GREEN,'R');
31
        else putc_xy(72+3,0,RED,' ');
32
        if (isLeftShift(k)) putc_xy(72+4,0,YELLOW,'L');
33
        else putc_xy(72+4,0,RED,' ');
34
        if (isRightShift(k)) putc_xy(72+5,0,YELLOW,'R');
35
        else putc_xy(72+5,0,RED,' ');
36
 
37
        cprintf("%d [%c]\t",k.scan,k.ascii);
38
 
39
    }
40
    sys_end();
41
    return 0;
42
}