Use alphabetic characters, so button symbols can be used as identifiers
This commit is contained in:
10
keyboard.ts
10
keyboard.ts
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user