-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send gamepad and keyboard inputs from renderer to main
- Loading branch information
Showing
7 changed files
with
176 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Assigns a numeric identifier to each valid input key that may be sent to a robot. Char codes are | ||
* unsuitable for this purpose because keys are sent as a bitmap of a 53 bit float (Javascript's | ||
* native number type). | ||
*/ | ||
export default Object.freeze({ | ||
a: 0, | ||
b: 1, | ||
c: 2, | ||
d: 3, | ||
e: 4, | ||
f: 5, | ||
g: 6, | ||
h: 7, | ||
i: 8, | ||
j: 9, | ||
k: 10, | ||
l: 11, | ||
m: 12, | ||
n: 13, | ||
o: 14, | ||
p: 15, | ||
q: 16, | ||
r: 17, | ||
s: 18, | ||
t: 19, | ||
u: 20, | ||
v: 21, | ||
w: 22, | ||
x: 23, | ||
y: 24, | ||
z: 25, | ||
'1': 26, | ||
'2': 27, | ||
'3': 28, | ||
'4': 29, | ||
'5': 30, | ||
'6': 31, | ||
'7': 32, | ||
'8': 33, | ||
'9': 34, | ||
'0': 35, | ||
',': 36, | ||
'.': 37, | ||
'/': 38, | ||
';': 39, | ||
"'": 40, | ||
'[': 41, | ||
']': 42, | ||
ArrowLeft: 43, | ||
ArrowRight: 44, | ||
ArrowUp: 45, | ||
ArrowDown: 46, | ||
}) as Readonly<{ [key: string]: number }>; |