Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

//#include <string.h>
//#include <stdlib.h>
//#include <cons.h>


#include <kernel/kern.h>
#include <drivers/keyb.h>

int main(int argc, char **argv)
{
    KEY_EVT k;
    clear();
    k.ascii = 0;
    while (k.ascii != ESC) {
        keyb_getcode(&k,BLOCK);
        if (k.ascii == '2') {
            keyb_set_map(itaMap);
            cprintf("\nItalian Keymap set\n");
        }
        if (k.ascii == '3') {
            keyb_set_map(engMap);
            cprintf("\nEnglish Keymap set\n");
        }
        if (isLeftCtrl(k)) putc_xy(72+0,0,RED,'L');
        else putc_xy(72+0,0,RED,' ');
        if (isRightCtrl(k)) putc_xy(72+1,0,RED,'R');
        else putc_xy(72+1,0,RED,' ');
        if (isLeftAlt(k)) putc_xy(72+2,0,GREEN,'L');
        else putc_xy(72+2,0,RED,' ');
        if (isRightAlt(k)) putc_xy(72+3,0,GREEN,'R');
        else putc_xy(72+3,0,RED,' ');
        if (isLeftShift(k)) putc_xy(72+4,0,YELLOW,'L');
        else putc_xy(72+4,0,RED,' ');
        if (isRightShift(k)) putc_xy(72+5,0,YELLOW,'R');
        else putc_xy(72+5,0,RED,' ');
       
        cprintf("%d [%c]\t",k.scan,k.ascii);

    }
    sys_end();
    return 0;
}