================================================================== MikeOS -- The Mike Operating System kernel KEYBOARD HANDLING ROUTINES ==================================================================
Waits for keypress and returns key
Example:
; can be used to halt program execution until user presses a key call os_wait_for_key
Scans keyboard for input, but doesn't wait
Example:
; Can be used to check for different keys and act accordingly
; and yes the scan codes are correct for SCAN SET 1.
; For SCAN SETS 2 & 3, the "1" = 16h and the "2" = 1Eh
; Some USB keyboards map the "1" = 1Eh and the "2" = 1Fh
Get_Option_Key:
call os_check_for_key
cmp ax, 2 ; check if the "1" key was pressed
jz One_was_Pressed
cmp ax, 3 ; check if the "2" key was pressed
jz Two_Was_Pressed
jmp Get_Option_Key ; none of the options pressed so loop
One_was_Pressed:
; code goes here for when the "1" key is pressed
jmp Main_Loop
Two_was_Pressed:
; code goes here for when the "2" key is pressed
jmp Main_Loop