|
LumaOS
v0.1.116
An experimental x86-64 OS
|
Handler and utilities for the keyboard. More...
Go to the source code of this file.
Data Structures | |
| struct | key_event |
| A decoded key event. More... | |
Macros | |
| #define | PS2_DATA 0x60 |
| #define | PS2_STATUS 0x64 |
| #define | PS2_COMMAND 0x64 |
| #define | KBD_BUF_SIZE 256 |
Functions | |
| static void | ps2_wait_write (void) |
| Wait until ps/2 input buffer is empty. | |
| static void | ps2_wait_read (void) |
| wait until a byte is waiting | |
| void | keyboard_init (void) |
| Initialize the keyboard driver and register the handler with the IRQ handler. | |
| int | kbd_buf_pop (void) |
| Pops byte from the keyboard key buffer. | |
| bool | kbd_decode (uint8_t raw, struct key_event *ev) |
| Convert a keyboard byte into the correct char. | |
| int | kbd_getchar (void) |
| Waits for a key to be pressed and returns the character. | |
Variables | |
| bool | shift_down |
| Keyboard modifier key status. | |
| bool | ctrl_down |
| bool | alt_down |
| bool | caps_on |
Handler and utilities for the keyboard.
Definition in file keyboard.h.
| #define KBD_BUF_SIZE 256 |
Definition at line 21 of file keyboard.h.
| #define PS2_COMMAND 0x64 |
Definition at line 19 of file keyboard.h.
| #define PS2_DATA 0x60 |
Definition at line 17 of file keyboard.h.
| #define PS2_STATUS 0x64 |
Definition at line 18 of file keyboard.h.
| int kbd_buf_pop | ( | void | ) |
Pops byte from the keyboard key buffer.
Definition at line 61 of file keyboard.c.
| bool kbd_decode | ( | uint8_t | raw, |
| struct key_event * | ev ) |
Convert a keyboard byte into the correct char.
| raw | The raw byte from the keyboard |
| ev | The key event to write to. |
Definition at line 78 of file keyboard.c.
| int kbd_getchar | ( | void | ) |
Waits for a key to be pressed and returns the character.
Definition at line 68 of file keyboard.c.
| void keyboard_init | ( | void | ) |
Initialize the keyboard driver and register the handler with the IRQ handler.
Definition at line 128 of file keyboard.c.
|
inlinestatic |
wait until a byte is waiting
Definition at line 45 of file keyboard.h.
|
inlinestatic |
Wait until ps/2 input buffer is empty.
Definition at line 40 of file keyboard.h.
| bool alt_down |
Definition at line 35 of file keyboard.h.
| bool caps_on |
Definition at line 35 of file keyboard.h.
| bool ctrl_down |
Definition at line 35 of file keyboard.h.
|
extern |
Keyboard modifier key status.
Definition at line 30 of file keyboard.c.