StuBS
|
Handles keystrokes. More...
#include <device/keyboard.h>
Public Member Functions | |
Keyboard () | |
Constructor. | |
void | plugin () |
Initialization of the keyboard. More... | |
bool | prologue () override |
Prologue of keyboard interrupts. More... | |
void | epilogue () override |
Epilogue of keyboard interrupts. More... | |
Public Member Functions inherited from Gate | |
Gate () | |
Constructor. | |
virtual | ~Gate () |
Destructor. More... | |
virtual bool | prologue ()=0 |
Device-specific interrupt handling routine that is executed immediately after the interrupt occurs (asynchronously). More... | |
virtual void | epilogue () |
Possibly delayed, synchronously executed Device-specific interrupt handling routine. More... | |
Handles keystrokes.
This class ensures correct initialization of the keyboard and, above all, its interrupt handling.
void Keyboard::plugin | ( | ) |
Initialization of the keyboard.
Initialization of the keyboard and activation of the specific interrupt handling: The object will register itself at the Plugbox and configure the IOAPIC to receive the corresponding interrupts.
|
overridevirtual |
Prologue of keyboard interrupts.
This method directly handles interrupts caused by the keyboard. Since multiple interrupts are triggered on a keystroke (press & release) it produces not always a printable ASCII character – therefore only valid keys are handled in the Keyboard::epilogue.
Since the buffer is limited, it also ensures that a valid key is not overwritten by a subsequent prologue before it was handled in the Keyboard::epilogue.
true
if a new Key was stored in the buffer and has to be processed in the Keyboard::epilogue. Implements Gate.
|
overridevirtual |
Epilogue of keyboard interrupts.
The character of the keystroke is read out and printed on the screen using the TextStream.
Reimplemented from Gate.