Use alphabetic characters, so button symbols can be used as identifiers

This commit is contained in:
dylan
2023-05-09 08:19:20 -07:00
parent 2ac5f3dff7
commit 1211891f53
3 changed files with 35 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
import { font } from "./font.ts";
import { font, CHAR } from "./font.ts";
const keyboard = new Map<number, {first: boolean, repeat: boolean, held: boolean}>();
@@ -63,10 +63,10 @@ export const shiftMap = {
}
export const altMap = {
"w": "⬆",
"a": "⬅",
"s": "⬇",
"d": "➡",
"w": CHAR.UP,
"a": CHAR.LEFT,
"s": CHAR.DOWN,
"d": CHAR.RIGHT,
}
addEventListener("keydown", (evt) => {