2024-01-09 02:29:45 +01:00
|
|
|
;;********************************************************************************
|
2024-08-08 21:11:25 +02:00
|
|
|
;; @file
|
|
|
|
;; @brief Simple PS/2 keyboard handler
|
|
|
|
;; @ingroup libs
|
2024-01-09 02:29:45 +01:00
|
|
|
;; @details:
|
|
|
|
;; This module processes keyboard scancodes from the ps2_keyboard driver.
|
|
|
|
;; It requires a PS/2 keyboard that supports scancode set 3.
|
|
|
|
;;
|
2024-08-08 00:11:15 +02:00
|
|
|
;; @section what What it does
|
2024-01-09 02:29:45 +01:00
|
|
|
;; - swallow break (release) scancodes
|
|
|
|
;;
|
|
|
|
;; This handler is designed for debug purposes.
|
|
|
|
;;
|
2024-08-08 00:11:15 +02:00
|
|
|
;; @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.
|
|
|
|
;;
|
2024-08-08 00:11:15 +02:00
|
|
|
;; @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.
|
|
|
|
;;
|
2024-08-08 00:11:15 +02:00
|
|
|
;; 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"
|
|
|
|
|
2024-08-08 00:11:15 +02:00
|
|
|
|
|
|
|
;;********************************************************************************
|
|
|
|
;; @brief Simple Keyboard Handler
|
|
|
|
;;********************************************************************************
|
2024-01-09 02:29:45 +01:00
|
|
|
.scope skb
|
|
|
|
Import skb, init, scancode
|
|
|
|
|
|
|
|
K_BREAK = $F0
|
|
|
|
.endscope
|
|
|
|
.endif ; guard
|