Kernel: Add basic PS/2 Mouse driver
This commit is contained in:
@@ -6,7 +6,7 @@ namespace APIC
|
||||
{
|
||||
|
||||
void Initialize(bool force_pic = false);
|
||||
void EOI();
|
||||
void EOI(uint8_t irq);
|
||||
void GetISR(uint32_t[8]);
|
||||
void EnableIRQ(uint8_t irq);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace Keyboard
|
||||
namespace Input
|
||||
{
|
||||
|
||||
enum class Key : uint8_t
|
||||
@@ -37,13 +37,30 @@ namespace Keyboard
|
||||
bool pressed;
|
||||
};
|
||||
|
||||
bool initialize();
|
||||
void update_keyboard();
|
||||
enum class MouseButton
|
||||
{
|
||||
Left, Right, Middle,
|
||||
};
|
||||
struct MouseButtonEvent
|
||||
{
|
||||
MouseButton button;
|
||||
};
|
||||
|
||||
void register_key_event_callback(void(*callback)(KeyEvent));
|
||||
struct MouseMoveEvent
|
||||
{
|
||||
int16_t dx;
|
||||
int16_t dy;
|
||||
};
|
||||
|
||||
|
||||
bool initialize();
|
||||
void update();
|
||||
bool is_key_down(Key);
|
||||
|
||||
void register_key_event_callback(void (*callback)(KeyEvent));
|
||||
void register_mouse_button_event_callback(void (*callback)(MouseButtonEvent));
|
||||
void register_mouse_move_event_callback(void (*callback)(MouseMoveEvent));
|
||||
|
||||
const char* key_event_to_utf8(KeyEvent);
|
||||
|
||||
void led_disco();
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/Keyboard.h>
|
||||
#include <kernel/Input.h>
|
||||
|
||||
namespace Keyboard
|
||||
namespace Input
|
||||
{
|
||||
|
||||
constexpr Key scan_code_to_key_extended[0xFF]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <BAN/String.h>
|
||||
#include <kernel/Keyboard.h>
|
||||
#include <kernel/Input.h>
|
||||
#include <kernel/TTY.h>
|
||||
|
||||
namespace Kernel
|
||||
@@ -22,7 +22,7 @@ namespace Kernel
|
||||
Shell();
|
||||
void PrintPrompt();
|
||||
void ProcessCommand(const BAN::Vector<BAN::StringView>&);
|
||||
void KeyEventCallback(Keyboard::KeyEvent);
|
||||
void KeyEventCallback(Input::KeyEvent);
|
||||
|
||||
private:
|
||||
TTY* m_tty;
|
||||
|
||||
Reference in New Issue
Block a user