forked from mozilla/pluotsorbet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
game-ui.js
39 lines (30 loc) · 873 Bytes
/
game-ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
document.getElementById("up").onmousedown = function() {
MIDP.sendKeyPress(119);
}
document.getElementById("up").onmouseup = function() {
MIDP.sendKeyRelease(119);
}
document.getElementById("down").onmousedown = function() {
MIDP.sendKeyPress(115);
}
document.getElementById("down").onmouseup = function() {
MIDP.sendKeyRelease(115);
}
document.getElementById("left").onmousedown = function() {
MIDP.sendKeyPress(97);
}
document.getElementById("left").onmouseup = function() {
MIDP.sendKeyRelease(97);
}
document.getElementById("right").onmousedown = function() {
MIDP.sendKeyPress(100);
}
document.getElementById("right").onmouseup = function() {
MIDP.sendKeyRelease(100);
}
document.getElementById("fire").onmousedown = function() {
MIDP.sendKeyPress(32);
}
document.getElementById("fire").onmouseup = function() {
MIDP.sendKeyRelease(32);
}