Ticket #5163: modifiers_check.patch
File modifiers_check.patch, 1.7 KB (added by , 14 years ago) |
---|
-
src/system/boot/platform/bios_ia32/keyboard.cpp
33 33 } 34 34 35 35 36 static uint16 37 check_for_modifiers(void) 38 { 39 bios_regs regs; 40 regs.eax = 0x0200; 41 call_bios(0x16, ®s); 42 43 return regs.eax & 0xffff; 44 } 45 46 36 47 extern "C" void 37 48 clear_key_buffer(void) 38 49 { … … 54 65 return key; 55 66 } 56 67 68 #define RIGHT_SHIFT 1 69 #define LEFT_SHIFT 1 70 #define CTRL 4 71 #define ALT 8 57 72 58 73 extern "C" uint32 59 74 check_for_boot_keys(void) 60 75 { 61 76 union key key; 62 77 uint32 options = 0; 78 uint32 modifiers = check_for_modifiers(); 79 80 if (modifiers & (CTRL | ALT)) 81 options |= BOOT_OPTION_MENU; 63 82 83 if (modifiers & (LEFT_SHIFT | RIGHT_SHIFT)) 84 options |= BOOT_OPTION_DEBUG_OUTPUT; 85 86 #if 0 87 // wait a bit to give the user the opportunity to press a key 88 spin(750000); 89 64 90 while ((key.ax = check_for_key()) != 0) { 65 91 switch (key.code.ascii) { 66 92 case ' ': … … 75 101 break; 76 102 } 77 103 } 78 104 #endif 79 105 dprintf("options = %ld\n", options); 80 106 return options; 81 107 } -
src/system/boot/platform/bios_ia32/start.c
129 129 mmu_init(); 130 130 parse_multiboot_commandline(&args); 131 131 132 // wait a bit to give the user the opportunity to press a key133 spin(750000);134 135 132 // reading the keyboard doesn't seem to work in graphics mode 136 133 // (maybe a bochs problem) 137 134 sBootOptions = check_for_boot_keys();