Skip to content

Commit

Permalink
Control + H support #159
Browse files Browse the repository at this point in the history
  • Loading branch information
double-fault committed Jan 16, 2017
1 parent 6eda42f commit fd7936a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/platform/pc/drv/ps2/kbd/kbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ extern int uninit_kbd();
extern const char QWERTY_EN_NOSHIFT[] ;
extern const char QWERTY_EN_SHIFT[];
extern int key_press(uint8_t scancode);
extern void key_handler();
extern void key_handler();
extern void key_handler_util_backspace();
extern uint8_t kbd_ctrl_read_status_reg();
extern void kbd_ctrl_send_cmd(uint8_t cmd);
extern uint8_t kbd_enc_read_input_buf();
Expand Down
10 changes: 8 additions & 2 deletions platform/pc/drv/ps2/kbd/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ void key_release(uint8_t scancode)
kbd_info.is_shift = false;
}

kbd_info.is_ctrl = false;
if ((int)(scancode) == 29) //Scancode of "Control" key
kbd_info.is_ctrl = false;
}

/*
Expand Down Expand Up @@ -198,6 +199,11 @@ void key_handler_util(int key)
cmds [CMD_CLEAR_INDEX]->handler ("clear");
return;
}
else if (key == 'h' || key == 'H')
{
key_handler_util_backspace();
return;
}
}

if(isalpha(key)==0)
Expand Down Expand Up @@ -422,7 +428,7 @@ void key_handler()
void kbd_handler(int_regs *r)
{
if(r){};
kbd_info.scancode =kbd_enc_read_input_buf();
kbd_info.scancode = kbd_enc_read_input_buf();

if(kbd_info.scancode & 0x80)
key_release(kbd_info.scancode & ~0x80);
Expand Down

0 comments on commit fd7936a

Please sign in to comment.