Subversion Repositories HelenOS-historic

Rev

Rev 1694 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1694 Rev 1699
Line 78... Line 78...
78
    1,
78
    1,
79
    msim_cmds
79
    msim_cmds
80
};
80
};
81
 
81
 
82
static int msim,gxemul;
82
static int msim,gxemul;
-
 
83
static int fb_fb;
-
 
84
 
83
 
85
 
84
int kbd_arch_init(void)
86
int kbd_arch_init(void)
85
{
87
{
-
 
88
    fb_fb=sysinfo_value("fb.kind")==1;
86
    ipc_register_irq(2, &msim_kbd);
89
    ipc_register_irq(2, &msim_kbd);
87
    msim=sysinfo_value("machine.msim");
-
 
88
    gxemul=sysinfo_value("machine.lgxemul");
-
 
89
    return 0;
90
    return 0;
90
}
91
}
91
 
92
 
92
 
93
 
93
//*
94
/*
94
//*
95
//*
95
//* Please preserve this code (it can be used to determine scancodes)
96
//* Please preserve this code (it can be used to determine scancodes)
96
//*
97
//*
97
int to_hex(int v)
98
int to_hex(int v)
98
{
99
{
99
        return "0123456789ABCDEF"[v];
100
        return "0123456789ABCDEF"[v];
100
}
101
}
101
//*/
102
*/
102
 
103
 
103
static int kbd_arch_process_msim(keybuffer_t *keybuffer, int scan_code)
104
static int kbd_arch_process_no_fb(keybuffer_t *keybuffer, int scan_code)
104
{
105
{
105
 
106
 
106
    static unsigned long buf=0;
107
    static unsigned long buf=0;
107
    static int count=0;
108
    static int count=0;
108
 
109
 
109
 
110
 
110
    //* Please preserve this code (it can be used to determine scancodes)
111
    /* Please preserve this code (it can be used to determine scancodes)
111
    //*
-
 
112
    //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf));
-
 
113
    //keybuffer_push(keybuffer, to_hex(scan_code&0xf));
-
 
114
    //keybuffer_push(keybuffer, ' ');
-
 
115
    //keybuffer_push(keybuffer, ' ');
-
 
116
    //*/
-
 
117
    //return 1;
-
 
118
   
112
   
-
 
113
    keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf));
-
 
114
    keybuffer_push(keybuffer, to_hex(scan_code&0xf));
-
 
115
    keybuffer_push(keybuffer, ' ');
-
 
116
    keybuffer_push(keybuffer, ' ');
-
 
117
   
-
 
118
    return 1;
-
 
119
    */
119
   
120
   
120
    if(scan_code==0x7e)
121
    if(scan_code==0x7e)
121
    {
122
    {
122
        switch (buf){
123
        switch (buf){
123
            case MSIM_KEY_F5:
124
            case MSIM_KEY_F5:
Line 249... Line 250...
249
    return 1;
250
    return 1;
250
}
251
}
251
 
252
 
252
 
253
 
253
 
254
 
254
static int kbd_arch_process_gxemul(keybuffer_t *keybuffer, int scan_code)
255
static int kbd_arch_process_fb(keybuffer_t *keybuffer, int scan_code)
255
{
256
{
256
 
257
 
257
    static unsigned long buf=0;
258
    static unsigned long buf=0;
258
    static int count=0;
259
    static int count=0;
259
 
260
 
260
 
261
 
261
    //* Please preserve this code (it can be used to determine scancodes)
262
    /* Please preserve this code (it can be used to determine scancodes)
262
    //*
-
 
263
    //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf));
-
 
264
    //keybuffer_push(keybuffer, to_hex(scan_code&0xf));
-
 
265
    //keybuffer_push(keybuffer, ' ');
-
 
266
    //keybuffer_push(keybuffer, ' ');
-
 
267
    //*/
-
 
268
    //return 1;
-
 
269
   
263
   
-
 
264
    keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf));
-
 
265
    keybuffer_push(keybuffer, to_hex(scan_code&0xf));
-
 
266
    keybuffer_push(keybuffer, ' ');
-
 
267
    keybuffer_push(keybuffer, ' ');
-
 
268
   
-
 
269
    return 1;
-
 
270
    */
270
   
271
   
271
    if ( scan_code == '\r' )
272
    if ( scan_code == '\r' )
272
        scan_code = '\n' ;
273
        scan_code = '\n' ;
273
   
274
   
274
    buf|=((unsigned long) scan_code)<<(8*(count++));
275
    buf|=((unsigned long) scan_code)<<(8*(count++));
Line 387... Line 388...
387
        }  
388
        }  
388
    } else {
389
    } else {
389
        esc_count=0;
390
        esc_count=0;
390
    }
391
    }
391
 
392
 
392
    if(msim) return kbd_arch_process_msim(keybuffer, scan_code);
393
    if(fb_fb) return kbd_arch_process_fb(keybuffer, scan_code);
393
    if(gxemul) return kbd_arch_process_gxemul(keybuffer, scan_code);
394
    return kbd_arch_process_no_fb(keybuffer, scan_code);
394
 
395
 
395
    return 0;
396
    return 0;
396
}
397
}
397
 
-
 
398
/**
-
 
399
 * @}
398
/** @}
400
 */
399
*/