diff --git a/driver/keyboard.c b/driver/keyboard.c index d438216..42e7dca 100644 --- a/driver/keyboard.c +++ b/driver/keyboard.c @@ -102,12 +102,18 @@ int handle_keyboard_input(){ int release = key & 0xb10000000; char c = key_status->is_shift ? shift_keyboard_map[(unsigned char )key] : keyboard_map[(unsigned char )key]; + if(!release) { if(c == -1) { key_status->is_shift = 1; return 0; } + if(key == 29){ + key_status->is_ctrl = 1; + return 0; + } + if(c == 0) return 0; queue_push(key_char_queue,(char)c); @@ -115,6 +121,11 @@ int handle_keyboard_input(){ if(c == -1){ key_status->is_shift = 0; } + + if(key == 29){ + key_status->is_ctrl = 0; + return 0; + } } return 0; diff --git a/include/keyboard.h b/include/keyboard.h index 5c65b4c..8cc70b1 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -6,6 +6,8 @@ typedef struct { int is_shift; + int is_ctrl; + int is_esc; }KEY_STATUS; typedef struct {