1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:57:35 +00:00

Start working on virtual consoles/TTYs.

This is a mess right now, but I'd rather commit as I go.
This commit is contained in:
Andreas Kling 2018-10-30 13:59:29 +01:00
parent bd2b5327d0
commit 68739dc43e
22 changed files with 611 additions and 344 deletions

View file

@ -6,11 +6,21 @@
#include <VirtualFileSystem/CharacterDevice.h>
#include "IRQHandler.h"
class KeyboardClient {
public:
virtual ~KeyboardClient();
virtual void onKeyPress(byte) = 0;
};
class Keyboard final : public IRQHandler, public CharacterDevice {
public:
static Keyboard& the() PURE;
virtual ~Keyboard() override;
Keyboard();
void setClient(KeyboardClient*);
private:
// ^IRQHandler
virtual void handleIRQ() override;
@ -20,6 +30,7 @@ private:
virtual ssize_t write(const byte* buffer, size_t) override;
virtual bool hasDataAvailableForRead() const override;
KeyboardClient* m_client { nullptr };
CircularQueue<byte, 16> m_queue;
byte m_modifiers { 0 };
};