Starting on keyboard stuff
This commit is contained in:
23
repl.ts
Normal file
23
repl.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import faux from "./builtins.ts";
|
||||
import { getKeysPressed } from "./keyboard.ts";
|
||||
import { font } from "./font.ts";
|
||||
|
||||
let line = "";
|
||||
|
||||
const update = () => {
|
||||
for (const key of getKeysPressed()) {
|
||||
const char = key.toLowerCase();
|
||||
if (char in font) {
|
||||
line += char;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const draw = () => {
|
||||
faux.clear_screen();
|
||||
faux.draw_text(0, 0, "> "+line);
|
||||
}
|
||||
|
||||
export const repl = {
|
||||
update, draw
|
||||
}
|
Reference in New Issue
Block a user