-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (25 loc) · 813 Bytes
/
main.cpp
File metadata and controls
29 lines (25 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "main.h"
extern "C" void entry_point()
{
Kernel kernel;
kernel.PrintString("This is a test\n", VIDEO_COLOR_TABLE::WHITE);
kernel.PrintString("Type anything below:\n", VIDEO_COLOR_TABLE::CYAN);
Keyboard keyboard;
bool keyPressed = false; // State to track if a key has been pressed
while (1)
{
const char key = keyboard.GetInput();
if (key)
{
if (!keyPressed) // Check if the key hasn't been pressed before
{
keyPressed = true; // Mark that the key has been pressed
kernel.PrintCharacter(key, VIDEO_COLOR_TABLE::WHITE);
}
}
else
{
keyPressed = false; // Mark that the key has been released
}
}
}