Skip to content

Commit

Permalink
Control + A support #159
Browse files Browse the repository at this point in the history
  • Loading branch information
double-fault committed Jan 22, 2017
1 parent 73f6401 commit 120c467
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion include/platform/pc/drv/ps2/kbd/kbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
#define KBD_RIGHT_KEY_ID 0x101005
#define KBD_CAPS_PRESS_ID 0x101006
#define KBD_ENTER_PRESS_ID 0x101007
#define KBD_CONTROL_PRESS_ID 0x101008
#define KBD_CONTROL_PRESS_ID 0x101008
#define KBD_HOME_KEY_ID 0x101009
#define KBD_END_KEY_ID 0x101010



Expand Down
16 changes: 15 additions & 1 deletion platform/pc/drv/ps2/kbd/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include <misc/status_codes.h>
#include <cpu/interrupts/interrupts.h>
#include <cpu/interrupts/irq.h>
#include <libc/stdio/stdio.h>
#include <libc/stdio/stdio.h>
#include <libc/stdlib/panik/panik.h>
#include <boneshell/boneshell.h>
#include <string/string.h>
#include <stdint.h>
Expand Down Expand Up @@ -258,6 +259,19 @@ void key_handler_util(int key)
key_handler();
kbd_info.key = ' ';
return;
}
else if (key == 'a' || key == 'A')
{
virtual_index_scank = 0;
virtual_cursor_pos = LENGTH_INPUT;
video_drivers[VGA_VIDEO_DRIVER_INDEX]->update_cursor
(video_drivers[VGA_VIDEO_DRIVER_INDEX]->video_row,video_drivers[VGA_VIDEO_DRIVER_INDEX]->video_column - virtual_cursor_pos
,__crsr_start,__crsr_end);
return;
}
else if (key == 'c' || key == 'C')
{
return;
}
}

Expand Down
4 changes: 2 additions & 2 deletions platform/pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ int const QWERTY_USA_NOSHIFT_VAL[] =
0, /* < ... F10 */
0, /* 69 - Num lock*/
0, /* Scroll Lock */
0, /* Home key */
KBD_HOME_KEY_ID, /* Home key */
KBD_UP_KEY_ID, /* Up Arrow */
0, /* Page Up */
'-',
KBD_LEFT_KEY_ID, /* Left Arrow */
0,
KBD_RIGHT_KEY_ID, /* Right Arrow */
'+',
0, /* 79 - End key*/
KBD_END_KEY_ID, /* 79 - End key*/
KBD_DOWN_KEY_ID, /* Down Arrow */
0, /* Page Down */
0, /* Insert Key */
Expand Down

0 comments on commit 120c467

Please sign in to comment.