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:
parent
bd2b5327d0
commit
68739dc43e
22 changed files with 611 additions and 344 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue