This commit is contained in:
nub31
2025-08-31 21:27:08 +02:00
parent 68f00d12fe
commit 365ad14122
14 changed files with 232 additions and 110 deletions

View File

@@ -2,8 +2,6 @@
#include "idt.h"
#include "kernel.h"
#include "vga.h"
#include <stdbool.h>
#include <stdint.h>
#define SCANCODE_LEFT_SHIFT 42
#define SCANCODE_RIGHT_SHIFT 54
@@ -34,7 +32,7 @@ bool caps_lock = false;
static keyboard_handler_t keyboard_handlers[KEYBOARD_HANDLERS_LENGTH];
static int handler_index = 0;
char scan_code_to_ascii(uint8_t scan_code)
char scan_code_to_ascii(u8 scan_code)
{
if (scan_code >= 128)
{
@@ -53,8 +51,8 @@ char scan_code_to_ascii(uint8_t scan_code)
void handle_keyboard(const isr_frame_t* frame)
{
uint8_t code = inb(0x60);
uint8_t scan_code = code & 0x7F;
u8 code = inb(0x60);
u8 scan_code = code & 0x7F;
bool pressed = (code & 0x80) == 0;
switch (scan_code)