Skip to content

Commit

Permalink
CTRL + L support #159
Browse files Browse the repository at this point in the history
  • Loading branch information
double-fault committed Jan 16, 2017
1 parent 0835d6c commit bf47323
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 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 @@ -76,7 +76,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 int key_press(uint8_t scancode);
extern void key_handler();
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
19 changes: 18 additions & 1 deletion platform/pc/drv/ps2/kbd/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ void key_release(uint8_t scancode)
if (
kbd_layouts[kbd_info.current_kbd_layout_index]->scancode_no_shift[scancode] == KBD_LEFT_SHIFT_PRESS_ID ||
kbd_layouts[kbd_info.current_kbd_layout_index]->scancode_no_shift[scancode] == KBD_RIGHT_SHIFT_PRESS_ID
)
) {
kbd_info.is_shift = false;
}

kbd_info.is_ctrl = false;
}

/*
Expand Down Expand Up @@ -183,6 +186,20 @@ static inline void inc_al()
*/
void key_handler_util(int key)
{
//First checking for shortcut commands
if (kbd_info.is_ctrl == true)
{
if (key == 'l' || key == 'L')
{
cmds [CMD_CLEAR_INDEX]->handler ("clear");
printk (" ");
kbd_info.key = KBD_ENTER_PRESS_ID;
key_handler();
cmds [CMD_CLEAR_INDEX]->handler ("clear");
return;
}
}

if(isalpha(key)==0)
{
if(print_scank == true && active_scank == true)
Expand Down

0 comments on commit bf47323

Please sign in to comment.