summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-02 15:30:31 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-02 15:30:31 +0200
commit1193ca1ac272904d18d04ebb5bb27522484e0b0e (patch)
treeb349c2dc98350427f38a9376b6278247852a08ff /src/kernel
parent4089e006820e1029a2dd7093bae596b1b31d1686 (diff)
downloadabaos-1193ca1ac272904d18d04ebb5bb27522484e0b0e.tar.gz
abaos-1193ca1ac272904d18d04ebb5bb27522484e0b0e.tar.bz2
added ESC key in PS/2 keyboard driver
allow pressing ESC in graphics mode to return to text mode
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/kernel.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index b97c3ea..55dd6f9 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -267,13 +267,6 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context )
break;
case MODE_GRAPHICS:
- vga_text_restore( vga_text );
-
- if( vga_set_mode( vga, vga_make_mode( VGA_MODE_TYPE_TEXT, 640, 480, 4 ) ) ) {
- vga_text_set_cursor( vga_text, vga_text->cursor_x, vga_text->cursor_y );
- mouse_set_resolution( mouse, vga_text->res_x, vga_text->res_y );
- global_context->mode = MODE_TEXT;
- }
break;
}
@@ -297,6 +290,14 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context )
if( event->type == KEYBOARD_EVENT_TYPE_KEY_PRESSED ) {
if( event->key == KEYBOARD_KEY_ASCII ) {
((widget_t *)desktop)->vtable->on_key_down( &global_context->desktop, event->ascii_key );
+ } else if( event->key == KEYBOARD_KEY_ESC ) {
+ vga_text_restore( vga_text );
+
+ if( vga_set_mode( vga, vga_make_mode( VGA_MODE_TYPE_TEXT, 640, 480, 4 ) ) ) {
+ vga_text_set_cursor( vga_text, vga_text->cursor_x, vga_text->cursor_y );
+ mouse_set_resolution( mouse, vga_text->res_x, vga_text->res_y );
+ global_context->mode = MODE_TEXT;
+ }
}
}
break;