The Pedigree Project
0.1
src
system
kernel
machine
mach_virt
mach_virt/Keyboard.cc
1
/*
2
* Copyright (c) 2026, Pedigree Developers
3
*
4
* Permission to use, copy, modify, and distribute this software for any
5
* purpose with or without fee is hereby granted.
6
*/
7
8
#include "Keyboard.h"
9
10
#include "Serial.h"
11
12
VirtKeyboard::VirtKeyboard(
VirtSerial
& serial) : m_Serial(serial), m_DebugState(false) {}
13
14
void
VirtKeyboard::initialise
() {}
15
16
void
VirtKeyboard::setDebugState
(
bool
enabled) {
17
m_DebugState = enabled;
18
}
19
20
bool
VirtKeyboard::getDebugState() {
21
return
m_DebugState;
22
}
23
24
char
VirtKeyboard::getChar
() {
25
return
m_DebugState ? m_Serial.read() : 0;
26
}
27
28
char
VirtKeyboard::getCharNonBlock
() {
29
return
m_DebugState ? m_Serial.readNonBlock() : 0;
30
}
VirtKeyboard::getChar
char getChar() override
Definition
mach_virt/Keyboard.cc:24
VirtKeyboard::getCharNonBlock
char getCharNonBlock() override
Definition
mach_virt/Keyboard.cc:28
VirtKeyboard::setDebugState
void setDebugState(bool enabled) override
Definition
mach_virt/Keyboard.cc:16
VirtKeyboard::initialise
void initialise() override
Definition
mach_virt/Keyboard.cc:14
VirtSerial
Definition
kernel/machine/mach_virt/Serial.h:14
Generated on Tue Sep 29 2026 04:30:13 for The Pedigree Project by
1.9.8