Function report | 
Source Code:kernel\debug\kdb\kdb_keyboard.c | 
Create Date:2022-07-28 11:44:41 | 
| Last Modify:2020-03-17 19:12:05 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Check if the keyboard controller has a keypress for us.* Some parts (Enter Release, LED change) are still blocking polled here,* but hopefully they are all short.
Proto:int kdb_get_kbd_char(void)
Type:int
Parameter:Nothing
| 43 | If KDB_FLAG(NO_I8042) || KDB_FLAG(NO_VT_CONSOLE) || inb(Status register (R) ) == 0xff && inb(Keyboard data register (R/W) ) == 0xff Then | 
| 45 | kbd_exists = 0 | 
| 46 | Return -1 | 
| 48 | kbd_exists = 1 | 
| 50 | If (inb(Status register (R) ) & Keyboard output buffer full ) == 0 Then Return -1 | 
| 57 | scanstatus = inb(Status register (R) ) | 
| 62 | If scanstatus & Mouse output buffer full Then Return -1 | 
| 83 | If (scancode & 0x7f) == 0x1d Then | 
| 94 | If (scancode & 0x80) != 0 Then | 
| 95 | If scancode == 0x9c Then kbd_last_ret = 0 | 
| 97 | Return -1 | 
| 100 | scancode &= 0x7f | 
| 106 | If scancode == 0x3a Then | 
| 110 | shift_lock ^= 1 | 
| 115 | Return -1 | 
| 118 | If scancode == 0x0e Then | 
| 122 | Return 8 | 
| 127 | Case scancode == 0xF | 
| 128 | Return 9 | 
| 129 | Case scancode == 0x53 | 
| 130 | Return 4 | 
| 131 | Case scancode == 0x47 | 
| 132 | Return 1 | 
| 133 | Case scancode == 0x4F | 
| 134 | Return 5 | 
| 135 | Case scancode == 0x4B | 
| 136 | Return 2 | 
| 137 | Case scancode == 0x48 | 
| 138 | Return 16 | 
| 139 | Case scancode == 0x50 | 
| 140 | Return 14 | 
| 141 | Case scancode == 0x4D | 
| 142 | Return 6 | 
| 145 | If scancode == 0xe0 Then Return -1 | 
| 158 | If Not shift_lock && Not shift_key && Not ctrl_key Then | 
| 160 | Else if (shift_lock || shift_key) && key_maps[1] Then | 
| 164 | Else | 
| 165 | keychar = 0x0020 | 
| 166 | kdb_printf("Unknown state/scancode (%d)\n", scancode) | 
| 168 | keychar &= 0x0fff | 
| 172 | Case KTYP(keychar) == symbol that can be acted upon by CapsLock | 
| 173 | Case KTYP(keychar) == we depend on this being zero | 
| 181 | Default | 
| 182 | Return -1 | 
| 185 | If scancode == 0x1c Then | 
| 186 | kbd_last_ret = 1 | 
| 187 | Return 13 | 
| 190 | Return keychar & 0xff | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |