6502-OS/programs/ps2_keyboard_simple_handler.h65

38 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-01-09 02:29:45 +01:00
;;********************************************************************************
;; @module ps2_keyboard_simple_handler
;; @type system
;; @details:
;; This module processes keyboard scancodes from the ps2_keyboard driver.
;; It requires a PS/2 keyboard that supports scancode set 3.
;;
;; @section what What it does
2024-01-09 02:29:45 +01:00
;; - swallow break (release) scancodes
;;
;; This handler is designed for debug purposes.
;;
;; @section usage How to use it
;; Call `kb::init` and check if it was successful (`Z = 1`).
2024-01-09 02:29:45 +01:00
;; In your program loop, check if kb::scancode is 0. If it is not, a key has been pressed.
;;
;; @subsection change_behaviour Changing the keyboard behaviour
;; You can change the typematic rate and delay (see PS/2 keyboard command `0xF3`)
2024-01-09 02:29:45 +01:00
;; and the typematic behavior (make, make/release, typematic) for all keys.
;;
;; You may also send the echo (`0xEE`) and identify (`0xF2`) commands to the keyboard.
2024-01-09 02:29:45 +01:00
;;********************************************************************************
.ifndef INCLUDE_KEYBOARD_SIMPLE
INCLUDE_KEYBOARD_SIMPLE = 1
.include "ps2_keyboard.h65"
;;********************************************************************************
;; @brief Simple Keyboard Handler
;;********************************************************************************
2024-01-09 02:29:45 +01:00
.scope skb
Import skb, init, scancode
K_BREAK = $F0
.endscope
.endif ; guard