Add a bunch of TODOs

This commit is contained in:
dylan
2023-05-05 12:28:43 -07:00
parent b58a0d8cb1
commit b87529bf56
2 changed files with 13 additions and 0 deletions

View File

@ -115,6 +115,10 @@ export const shiftKeyDown = () => {
return keyDown(K.SHIFT_LEFT) || keyDown(K.SHIFT_RIGHT);
}
export const ctrlKeyDown = () => {
return keyDown(K.CTRL_LEFT) || keyDown(K.CTRL_RIGHT);
}
export const keyReleased = (key: string | number) => {
if (typeof key === "string") {
key = key.toUpperCase().charCodeAt(0);
@ -131,6 +135,9 @@ export const getKeysPressed = () => {
export const getKeyboardString = () => {
let str = "";
if (ctrlKeyDown()) {
return str;
}
for (const key of getKeysPressed()) {
let char = String.fromCharCode(key).toLowerCase();
if (shiftKeyDown()) {