Ticket #2918: kbd.1.diff
File kbd.1.diff, 2.8 KB (added by , 15 years ago) |
---|
-
src/system/kernel/arch/x86/arch_debug_console.c
104 104 * again if anything else requests the interrupt 1. 105 105 */ 106 106 107 bool tmp = false; 108 107 109 static int32 108 110 debug_keyboard_interrupt(void *data) 109 111 { … … 111 113 static bool altPressed; 112 114 uint8 key; 113 115 116 if (tmp) { 117 ktrace_printf("KS!\n"); 118 return B_HANDLED_INTERRUPT; 119 } 120 114 121 key = in8(PS2_PORT_DATA); 115 122 //dprintf("debug_keyboard_interrupt: key = 0x%x\n", key); 116 123 124 ktrace_printf("KSi\n"); 125 117 126 if (key & 0x80) { 118 127 if (key == LEFT_CONTROL) 119 128 controlPressed = false; … … 188 197 static uint8 special = 0; 189 198 static uint8 special2 = 0; 190 199 uint8 key = 0; 200 tmp=true; 201 ktrace_printf("KSa\n"); 191 202 192 203 if (special & 0x80) { 193 204 special &= ~0x80; 194 return '['; 205 ktrace_printf("KSb\n"); 206 tmp=false;return '['; 195 207 } 196 208 if (special != 0) { 197 209 key = special; 198 210 special = 0; 199 return key; 211 ktrace_printf("KSc\n"); 212 tmp=false;return key; 200 213 } 201 214 if (special2 != 0) { 202 215 key = special2; 203 216 special2 = 0; 204 return key; 217 ktrace_printf("KSd\n"); 218 tmp=false;return key; 205 219 } 206 220 207 221 while (true) { … … 220 234 // we read mouse data, ignore it 221 235 continue; 222 236 } 237 ktrace_printf("KSe\n"); 223 238 224 239 if (key & 0x80) { 225 240 // key up … … 254 269 // start escape sequence for cursor movement 255 270 case CURSOR_UP: 256 271 special = 0x80 | 'A'; 257 return '\x1b';272 tmp=false;return '\x1b'; 258 273 case CURSOR_DOWN: 259 274 special = 0x80 | 'B'; 260 return '\x1b';275 tmp=false;return '\x1b'; 261 276 case CURSOR_RIGHT: 262 277 special = 0x80 | 'C'; 263 return '\x1b';278 tmp=false;return '\x1b'; 264 279 case CURSOR_LEFT: 265 280 special = 0x80 | 'D'; 266 return '\x1b';281 tmp=false;return '\x1b'; 267 282 case CURSOR_HOME: 268 283 special = 0x80 | 'H'; 269 return '\x1b';284 tmp=false;return '\x1b'; 270 285 case CURSOR_END: 271 286 special = 0x80 | 'F'; 272 return '\x1b';287 tmp=false;return '\x1b'; 273 288 case PAGE_UP: 274 289 special = 0x80 | '5'; 275 290 special2 = '~'; 276 return '\x1b';291 tmp=false;return '\x1b'; 277 292 case PAGE_DOWN: 278 293 special = 0x80 | '6'; 279 294 special2 = '~'; 280 return '\x1b';295 tmp=false;return '\x1b'; 281 296 282 297 283 298 case DELETE: … … 286 301 287 302 special = 0x80 | '3'; 288 303 special2 = '~'; 289 return '\x1b';304 tmp=false;return '\x1b'; 290 305 291 306 default: 292 307 if (controlPressed) { 293 308 char c = kShiftedKeymap[key]; 294 309 if (c >= 'A' && c <= 'Z') 295 return 0x1f & c;310 tmp=false;return 0x1f & c; 296 311 } 297 312 298 313 if (altPressed) 299 return kAltedKeymap[key];314 tmp=false;return kAltedKeymap[key]; 300 315 301 return shiftPressed316 tmp=false;return shiftPressed 302 317 ? kShiftedKeymap[key] : kUnshiftedKeymap[key]; 303 318 } 304 319 }