Changeset d1c4b9e in mainline for kbd/arch/mips32/src/kbd.c
- Timestamp:
- 2006-06-06T19:34:47Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 80076f6
- Parents:
- f4b961f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kbd/arch/mips32/src/kbd.c
rf4b961f rd1c4b9e 30 30 #include <ipc/ipc.h> 31 31 32 33 #define KEY_F1 0x504f1bL 34 #define KEY_F2 0x514f1bL 35 #define KEY_F3 0x524f1bL 36 #define KEY_F4 0x534f1bL 37 #define KEY_F5 0x35315b1bL 38 #define KEY_F6 0x37315b1bL 39 #define KEY_F7 0x38315b1bL 40 #define KEY_F8 0x39315b1bL 41 #define KEY_F9 0x30325b1bL 42 #define KEY_F10 0x31325b1bL 43 #define KEY_F11 0x33325b1bL 44 #define KEY_F12 0x34325b1bL 45 46 47 #define FUNCTION_KEYS 0x100 48 49 32 50 irq_cmd_t msim_cmds[1] = { 33 51 { CMD_MEM_READ_1, (void *)0xB0000000, 0 } … … 45 63 } 46 64 65 66 /* 67 * 68 * Please preserve this code (it can be used to determine scancodes) 69 * 70 int to_hex(int v) 71 { 72 return "0123456789ABCDEF"[v]; 73 } 74 */ 75 47 76 int kbd_arch_process(keybuffer_t *keybuffer, int scan_code) 48 77 { 49 keybuffer_push(keybuffer, scan_code); 50 return 1; 78 79 static unsigned long buf=0; 80 static int count=0; 81 82 83 //* Please preserve this code (it can be used to determine scancodes) 84 //* 85 //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf)); 86 //keybuffer_push(keybuffer, to_hex(scan_code&0xf)); 87 //keybuffer_push(keybuffer, ' '); 88 //keybuffer_push(keybuffer, ' '); 89 //*/ 90 //return 1; 91 92 93 if(scan_code==0x7e) 94 { 95 switch (buf){ 96 case KEY_F5: 97 keybuffer_push(keybuffer,FUNCTION_KEYS | 5 ); 98 buf=count=0; 99 return 1; 100 case KEY_F6: 101 keybuffer_push(keybuffer,FUNCTION_KEYS | 6 ); 102 buf=count=0; 103 return 1; 104 case KEY_F7: 105 keybuffer_push(keybuffer,FUNCTION_KEYS | 7 ); 106 buf=count=0; 107 return 1; 108 case KEY_F8: 109 keybuffer_push(keybuffer,FUNCTION_KEYS | 8 ); 110 buf=count=0; 111 return 1; 112 113 case KEY_F9: 114 keybuffer_push(keybuffer,FUNCTION_KEYS | 9 ); 115 buf=count=0; 116 return 1; 117 case KEY_F10: 118 keybuffer_push(keybuffer,FUNCTION_KEYS | 10 ); 119 buf=count=0; 120 return 1; 121 122 case KEY_F11: 123 keybuffer_push(keybuffer,FUNCTION_KEYS | 11 ); 124 buf=count=0; 125 return 1; 126 case KEY_F12: 127 keybuffer_push(keybuffer,FUNCTION_KEYS | 12 ); 128 buf=count=0; 129 return 1; 130 default: 131 keybuffer_push(keybuffer, buf & 0xff ); 132 keybuffer_push(keybuffer, (buf >> 8) &0xff ); 133 keybuffer_push(keybuffer, (buf >> 16) &0xff ); 134 keybuffer_push(keybuffer, (buf >> 24) &0xff ); 135 keybuffer_push(keybuffer, scan_code ); 136 buf=count=0; 137 return 1; 138 139 } 140 } 141 142 buf|=((unsigned long) scan_code)<<(8*(count++)); 143 144 145 if((buf & 0xff)!= (KEY_F1 & 0xff)) { 146 147 keybuffer_push(keybuffer,buf ); 148 buf=count=0; 149 return 1; 150 } 151 152 if ( count <= 1 ) 153 return 1; 154 155 if( (buf & 0xffff) != (KEY_F1 & 0xffff) 156 && (buf & 0xffff) != (KEY_F5 & 0xffff) ) { 157 158 keybuffer_push(keybuffer, buf & 0xff ); 159 keybuffer_push(keybuffer, (buf >> 8) &0xff ); 160 buf=count=0; 161 return 1; 162 } 163 164 if ( count <= 2) 165 return 1; 166 167 switch (buf){ 168 case KEY_F1: 169 keybuffer_push(keybuffer,FUNCTION_KEYS | 1 ); 170 buf=count=0; 171 return 1; 172 case KEY_F2: 173 keybuffer_push(keybuffer,FUNCTION_KEYS | 2 ); 174 buf=count=0; 175 return 1; 176 case KEY_F3: 177 keybuffer_push(keybuffer,FUNCTION_KEYS | 3 ); 178 buf=count=0; 179 return 1; 180 case KEY_F4: 181 keybuffer_push(keybuffer,FUNCTION_KEYS | 4 ); 182 buf=count=0; 183 return 1; 184 } 185 186 187 if( (buf & 0xffffff) != (KEY_F5 & 0xffffff) 188 && (buf & 0xffffff) != (KEY_F9 & 0xffffff) ) { 189 190 keybuffer_push(keybuffer, buf & 0xff ); 191 keybuffer_push(keybuffer, (buf >> 8) &0xff ); 192 keybuffer_push(keybuffer, (buf >> 16) &0xff ); 193 buf=count=0; 194 return 1; 195 } 196 197 if ( count <= 3 ) 198 return 1; 199 200 201 202 203 switch (buf){ 204 case KEY_F5: 205 case KEY_F6: 206 case KEY_F7: 207 case KEY_F8: 208 case KEY_F9: 209 case KEY_F10: 210 case KEY_F11: 211 case KEY_F12: 212 return 1; 213 default: 214 keybuffer_push(keybuffer, buf & 0xff ); 215 keybuffer_push(keybuffer, (buf >> 8) &0xff ); 216 keybuffer_push(keybuffer, (buf >> 16) &0xff ); 217 keybuffer_push(keybuffer, (buf >> 24) &0xff ); 218 buf=count=0; 219 return 1; 220 221 } 222 return 1; 51 223 }
Note:
See TracChangeset
for help on using the changeset viewer.