Warning, cross-references for /kernel/drivers/input/keymap.c need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "drivers/input/keyboard.h"
0019
0020
0021
0022 static char lcase_scancode[128] =
0023 "\0\e1234567890-=\177\tqwertyuiop[]\n\0asdfghjkl;'`\0\\zxcvbnm,./\0*\0 \0\0\0\0\0\0\0\0\0\0\0\0\000789-456+1230.\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
0024 static char ucase_scancode[128] =
0025 "\0\e1234567890-=\177\tQWERTYUIOP[]\n\0ASDFGHJKL;'`\0\\ZXCVBNM,./\0*\0 \0\0\0\0\0\0\0\0\0\0\0\0\000789-456+1230.\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
0026
0027
0028
0029 uint8
0030 keymap_getchar (void)
0031 {
0032 int i;
0033 key_event e;
0034 bool shiftmod, ctrlmod, altmod;
0035 uint8 char_code = 0;
0036
0037 while (!char_code) {
0038 keyboard_8042_next (&e);
0039
0040 shiftmod = ctrlmod = altmod = FALSE;
0041 for (i=0; i<KEY_EVENT_MAX; i++) {
0042 if (e.keys[i].present && e.keys[i].pressed) {
0043 switch (e.keys[i].scancode) {
0044 case 0x2A:
0045 case 0x36:
0046 shiftmod = TRUE;
0047 break;
0048
0049 case 0x1D:
0050 case 0xE01D:
0051 ctrlmod = TRUE;
0052 break;
0053
0054 case 0x38:
0055 case 0xE038:
0056 altmod = TRUE;
0057 break;
0058
0059 default:
0060 if(e.keys[i].scancode < 128 && e.keys[i].latest)
0061 char_code = e.keys[i].scancode;
0062 break;
0063 }
0064 }
0065 }
0066 }
0067
0068 if (shiftmod)
0069 return ucase_scancode[char_code];
0070 else
0071 return lcase_scancode[char_code];
0072 }
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083