Move scancode-to-ASCII conversion into the terminal

This commit is contained in:
jn 2023-02-02 03:48:48 +01:00
parent ffdda5eaca
commit d03d49ac44
2 changed files with 4 additions and 4 deletions

View File

@ -21,11 +21,11 @@ shell_task_loop:
shell_task_parse_key: shell_task_parse_key:
; first, check if enter, delete, or backspace was pressed ; first, check if enter, delete, or backspace was pressed
cmp.8 r0, 0x1C ; enter cmp.8 r0, 0x0a ; enter
ifz jmp shell_key_down_enter ifz jmp shell_key_down_enter
cmp.8 r0, 0x6F ; delete cmp.8 r0, 0x7f ; delete
ifz jmp shell_key_down_backspace ifz jmp shell_key_down_backspace
cmp.8 r0, 0x0E ; backspace cmp.8 r0, 0x08 ; backspace
ifz jmp shell_key_down_backspace ifz jmp shell_key_down_backspace
; then, overwrite the cursor ; then, overwrite the cursor
@ -35,7 +35,6 @@ shell_task_parse_key:
mov r0, r1 mov r0, r1
; then, add it to the text buffer and print it to the screen ; then, add it to the text buffer and print it to the screen
call scancode_to_ascii
call print_character_to_terminal call print_character_to_terminal
call shell_push_character call shell_push_character

View File

@ -67,6 +67,7 @@ key_down:
ifz push event_loop_end ifz push event_loop_end
ifz jmp caps_pressed ifz jmp caps_pressed
call scancode_to_ascii
mov.8 [read_buffer], r0 mov.8 [read_buffer], r0
jmp event_loop_end jmp event_loop_end