2018-10-16 12:01:38 +03:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-22 13:58:29 +03:00
|
|
|
#include <AK/Types.h>
|
2018-10-23 11:12:50 +03:00
|
|
|
#include <AK/DoublyLinkedList.h>
|
|
|
|
#include <AK/CircularQueue.h>
|
|
|
|
#include <VirtualFileSystem/CharacterDevice.h>
|
2018-10-22 13:58:29 +03:00
|
|
|
#include "IRQHandler.h"
|
2018-10-16 12:01:38 +03:00
|
|
|
|
2018-10-23 11:12:50 +03:00
|
|
|
class Keyboard final : public IRQHandler, public CharacterDevice {
|
2018-10-22 13:58:29 +03:00
|
|
|
public:
|
|
|
|
virtual ~Keyboard() override;
|
|
|
|
Keyboard();
|
|
|
|
|
|
|
|
private:
|
2018-10-23 11:12:50 +03:00
|
|
|
// ^IRQHandler
|
2018-10-22 13:58:29 +03:00
|
|
|
virtual void handleIRQ() override;
|
2018-10-16 12:01:38 +03:00
|
|
|
|
2018-10-23 11:12:50 +03:00
|
|
|
// ^CharacterDevice
|
|
|
|
virtual ssize_t read(byte* buffer, size_t) override;
|
|
|
|
virtual ssize_t write(const byte* buffer, size_t) override;
|
2018-10-25 14:07:59 +03:00
|
|
|
virtual bool hasDataAvailableForRead() const override;
|
2018-10-23 11:12:50 +03:00
|
|
|
|
|
|
|
CircularQueue<byte, 16> m_queue;
|
2018-10-22 13:58:29 +03:00
|
|
|
byte m_modifiers { 0 };
|
|
|
|
};
|
2018-10-16 12:01:38 +03:00
|
|
|
|