Skip to content

Commit bb1cc89

Browse files
type to numbers
1 parent 1861fe5 commit bb1cc89

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

events/KeyCodes.ts

+17-14
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@
33
export let KeyCodes = {
44
BACKSPACE: 8,
55

6-
RETURN: "13",
7-
ESC: "27",
8-
SPACE: "32",
6+
RETURN: 13,
7+
ESC: 27,
8+
SPACE: 32,
99

10-
LEFT: "37",
11-
UP: "38",
12-
RIGHT: "39",
13-
DOWN: "40",
10+
LEFT: 37,
11+
UP: 38,
12+
RIGHT: 39,
13+
DOWN: 40,
1414

15-
ZERO: "48",
16-
ONE: "49",
17-
TWO: "50",
15+
ZERO: 48,
16+
ONE: 49,
17+
TWO: 50,
1818

19-
b: "66",
20-
F: "70",
21-
k: "75",
22-
m: "77"
19+
a: 65,
20+
b: 66,
21+
F: 70,
22+
k: 75,
23+
m: 77,
24+
25+
WIN_or_CMD:91 //to detect cmd on key up use this, on keydown you can use event.metaKey
2326
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vanilla-typescript",
3-
"version": "0.2.8",
3+
"version": "0.2.11",
44
"description": "",
55
"main": "index.ts",
66
"scripts": {

0 commit comments

Comments
 (0)