@bloopjs/engine 0.0.0 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/enums.d.ts +219 -0
- package/dist/codegen/enums.d.ts.map +1 -0
- package/dist/contexts/inputContext.d.ts +227 -0
- package/dist/contexts/inputContext.d.ts.map +1 -0
- package/dist/{timing.d.ts → contexts/timeContext.d.ts} +3 -3
- package/dist/contexts/timeContext.d.ts.map +1 -0
- package/dist/engine.d.ts +28 -43
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +552 -724
- package/dist/engine.js.map +8 -8
- package/dist/inputs.d.ts +23 -453
- package/dist/inputs.d.ts.map +1 -1
- package/dist/wasmEngine.d.ts +37 -8
- package/dist/wasmEngine.d.ts.map +1 -1
- package/package.json +4 -4
- package/wasm/bloop.wasm +0 -0
- package/dist/events.d.ts +0 -75
- package/dist/events.d.ts.map +0 -1
- package/dist/mod.d.ts +0 -37
- package/dist/mod.d.ts.map +0 -1
- package/dist/mod.js +0 -1115
- package/dist/mod.js.map +0 -12
- package/dist/runtime.d.ts +0 -31
- package/dist/runtime.d.ts.map +0 -1
- package/dist/timing.d.ts.map +0 -1
package/dist/engine.js
CHANGED
|
@@ -9,460 +9,339 @@ var __export = (target, all) => {
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
// js/
|
|
13
|
-
var
|
|
14
|
-
__export(
|
|
15
|
-
|
|
12
|
+
// js/codegen/enums.ts
|
|
13
|
+
var exports_enums = {};
|
|
14
|
+
__export(exports_enums, {
|
|
15
|
+
MouseButton: () => MouseButton,
|
|
16
|
+
Key: () => Key,
|
|
17
|
+
EventType: () => EventType
|
|
16
18
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
19
|
+
var EventType;
|
|
20
|
+
((EventType2) => {
|
|
21
|
+
EventType2[EventType2["None"] = 0] = "None";
|
|
22
|
+
EventType2[EventType2["KeyDown"] = 1] = "KeyDown";
|
|
23
|
+
EventType2[EventType2["KeyUp"] = 2] = "KeyUp";
|
|
24
|
+
EventType2[EventType2["MouseMove"] = 3] = "MouseMove";
|
|
25
|
+
EventType2[EventType2["MouseDown"] = 4] = "MouseDown";
|
|
26
|
+
EventType2[EventType2["MouseUp"] = 5] = "MouseUp";
|
|
27
|
+
EventType2[EventType2["MouseWheel"] = 6] = "MouseWheel";
|
|
28
|
+
EventType2[EventType2["FrameAdvance"] = 7] = "FrameAdvance";
|
|
29
|
+
})(EventType ||= {});
|
|
30
|
+
var MouseButton;
|
|
31
|
+
((MouseButton2) => {
|
|
32
|
+
MouseButton2[MouseButton2["None"] = 0] = "None";
|
|
33
|
+
MouseButton2[MouseButton2["Left"] = 1] = "Left";
|
|
34
|
+
MouseButton2[MouseButton2["Middle"] = 2] = "Middle";
|
|
35
|
+
MouseButton2[MouseButton2["Right"] = 3] = "Right";
|
|
36
|
+
MouseButton2[MouseButton2["X1"] = 4] = "X1";
|
|
37
|
+
MouseButton2[MouseButton2["X2"] = 5] = "X2";
|
|
38
|
+
MouseButton2[MouseButton2["X3"] = 6] = "X3";
|
|
39
|
+
MouseButton2[MouseButton2["X4"] = 7] = "X4";
|
|
40
|
+
MouseButton2[MouseButton2["X5"] = 8] = "X5";
|
|
41
|
+
})(MouseButton ||= {});
|
|
42
|
+
var Key;
|
|
43
|
+
((Key2) => {
|
|
44
|
+
Key2[Key2["None"] = 0] = "None";
|
|
45
|
+
Key2[Key2["Backquote"] = 1] = "Backquote";
|
|
46
|
+
Key2[Key2["Backslash"] = 2] = "Backslash";
|
|
47
|
+
Key2[Key2["BracketLeft"] = 3] = "BracketLeft";
|
|
48
|
+
Key2[Key2["BracketRight"] = 4] = "BracketRight";
|
|
49
|
+
Key2[Key2["Comma"] = 5] = "Comma";
|
|
50
|
+
Key2[Key2["Digit0"] = 6] = "Digit0";
|
|
51
|
+
Key2[Key2["Digit1"] = 7] = "Digit1";
|
|
52
|
+
Key2[Key2["Digit2"] = 8] = "Digit2";
|
|
53
|
+
Key2[Key2["Digit3"] = 9] = "Digit3";
|
|
54
|
+
Key2[Key2["Digit4"] = 10] = "Digit4";
|
|
55
|
+
Key2[Key2["Digit5"] = 11] = "Digit5";
|
|
56
|
+
Key2[Key2["Digit6"] = 12] = "Digit6";
|
|
57
|
+
Key2[Key2["Digit7"] = 13] = "Digit7";
|
|
58
|
+
Key2[Key2["Digit8"] = 14] = "Digit8";
|
|
59
|
+
Key2[Key2["Digit9"] = 15] = "Digit9";
|
|
60
|
+
Key2[Key2["Equal"] = 16] = "Equal";
|
|
61
|
+
Key2[Key2["IntlBackslash"] = 17] = "IntlBackslash";
|
|
62
|
+
Key2[Key2["IntlRo"] = 18] = "IntlRo";
|
|
63
|
+
Key2[Key2["IntlYen"] = 19] = "IntlYen";
|
|
64
|
+
Key2[Key2["KeyA"] = 20] = "KeyA";
|
|
65
|
+
Key2[Key2["KeyB"] = 21] = "KeyB";
|
|
66
|
+
Key2[Key2["KeyC"] = 22] = "KeyC";
|
|
67
|
+
Key2[Key2["KeyD"] = 23] = "KeyD";
|
|
68
|
+
Key2[Key2["KeyE"] = 24] = "KeyE";
|
|
69
|
+
Key2[Key2["KeyF"] = 25] = "KeyF";
|
|
70
|
+
Key2[Key2["KeyG"] = 26] = "KeyG";
|
|
71
|
+
Key2[Key2["KeyH"] = 27] = "KeyH";
|
|
72
|
+
Key2[Key2["KeyI"] = 28] = "KeyI";
|
|
73
|
+
Key2[Key2["KeyJ"] = 29] = "KeyJ";
|
|
74
|
+
Key2[Key2["KeyK"] = 30] = "KeyK";
|
|
75
|
+
Key2[Key2["KeyL"] = 31] = "KeyL";
|
|
76
|
+
Key2[Key2["KeyM"] = 32] = "KeyM";
|
|
77
|
+
Key2[Key2["KeyN"] = 33] = "KeyN";
|
|
78
|
+
Key2[Key2["KeyO"] = 34] = "KeyO";
|
|
79
|
+
Key2[Key2["KeyP"] = 35] = "KeyP";
|
|
80
|
+
Key2[Key2["KeyQ"] = 36] = "KeyQ";
|
|
81
|
+
Key2[Key2["KeyR"] = 37] = "KeyR";
|
|
82
|
+
Key2[Key2["KeyS"] = 38] = "KeyS";
|
|
83
|
+
Key2[Key2["KeyT"] = 39] = "KeyT";
|
|
84
|
+
Key2[Key2["KeyU"] = 40] = "KeyU";
|
|
85
|
+
Key2[Key2["KeyV"] = 41] = "KeyV";
|
|
86
|
+
Key2[Key2["KeyW"] = 42] = "KeyW";
|
|
87
|
+
Key2[Key2["KeyX"] = 43] = "KeyX";
|
|
88
|
+
Key2[Key2["KeyY"] = 44] = "KeyY";
|
|
89
|
+
Key2[Key2["KeyZ"] = 45] = "KeyZ";
|
|
90
|
+
Key2[Key2["Minus"] = 46] = "Minus";
|
|
91
|
+
Key2[Key2["Period"] = 47] = "Period";
|
|
92
|
+
Key2[Key2["Quote"] = 48] = "Quote";
|
|
93
|
+
Key2[Key2["Semicolon"] = 49] = "Semicolon";
|
|
94
|
+
Key2[Key2["Slash"] = 50] = "Slash";
|
|
95
|
+
Key2[Key2["AltLeft"] = 51] = "AltLeft";
|
|
96
|
+
Key2[Key2["AltRight"] = 52] = "AltRight";
|
|
97
|
+
Key2[Key2["Backspace"] = 53] = "Backspace";
|
|
98
|
+
Key2[Key2["CapsLock"] = 54] = "CapsLock";
|
|
99
|
+
Key2[Key2["ContextMenu"] = 55] = "ContextMenu";
|
|
100
|
+
Key2[Key2["ControlLeft"] = 56] = "ControlLeft";
|
|
101
|
+
Key2[Key2["ControlRight"] = 57] = "ControlRight";
|
|
102
|
+
Key2[Key2["Enter"] = 58] = "Enter";
|
|
103
|
+
Key2[Key2["MetaLeft"] = 59] = "MetaLeft";
|
|
104
|
+
Key2[Key2["MetaRight"] = 60] = "MetaRight";
|
|
105
|
+
Key2[Key2["ShiftLeft"] = 61] = "ShiftLeft";
|
|
106
|
+
Key2[Key2["ShiftRight"] = 62] = "ShiftRight";
|
|
107
|
+
Key2[Key2["Space"] = 63] = "Space";
|
|
108
|
+
Key2[Key2["Tab"] = 64] = "Tab";
|
|
109
|
+
Key2[Key2["Convert"] = 65] = "Convert";
|
|
110
|
+
Key2[Key2["KanaMode"] = 66] = "KanaMode";
|
|
111
|
+
Key2[Key2["Lang1"] = 67] = "Lang1";
|
|
112
|
+
Key2[Key2["Lang2"] = 68] = "Lang2";
|
|
113
|
+
Key2[Key2["Lang3"] = 69] = "Lang3";
|
|
114
|
+
Key2[Key2["Lang4"] = 70] = "Lang4";
|
|
115
|
+
Key2[Key2["Lang5"] = 71] = "Lang5";
|
|
116
|
+
Key2[Key2["NonConvert"] = 72] = "NonConvert";
|
|
117
|
+
Key2[Key2["Delete"] = 73] = "Delete";
|
|
118
|
+
Key2[Key2["End"] = 74] = "End";
|
|
119
|
+
Key2[Key2["Help"] = 75] = "Help";
|
|
120
|
+
Key2[Key2["Home"] = 76] = "Home";
|
|
121
|
+
Key2[Key2["Insert"] = 77] = "Insert";
|
|
122
|
+
Key2[Key2["PageDown"] = 78] = "PageDown";
|
|
123
|
+
Key2[Key2["PageUp"] = 79] = "PageUp";
|
|
124
|
+
Key2[Key2["ArrowDown"] = 80] = "ArrowDown";
|
|
125
|
+
Key2[Key2["ArrowLeft"] = 81] = "ArrowLeft";
|
|
126
|
+
Key2[Key2["ArrowRight"] = 82] = "ArrowRight";
|
|
127
|
+
Key2[Key2["ArrowUp"] = 83] = "ArrowUp";
|
|
128
|
+
Key2[Key2["NumLock"] = 84] = "NumLock";
|
|
129
|
+
Key2[Key2["Numpad0"] = 85] = "Numpad0";
|
|
130
|
+
Key2[Key2["Numpad1"] = 86] = "Numpad1";
|
|
131
|
+
Key2[Key2["Numpad2"] = 87] = "Numpad2";
|
|
132
|
+
Key2[Key2["Numpad3"] = 88] = "Numpad3";
|
|
133
|
+
Key2[Key2["Numpad4"] = 89] = "Numpad4";
|
|
134
|
+
Key2[Key2["Numpad5"] = 90] = "Numpad5";
|
|
135
|
+
Key2[Key2["Numpad6"] = 91] = "Numpad6";
|
|
136
|
+
Key2[Key2["Numpad7"] = 92] = "Numpad7";
|
|
137
|
+
Key2[Key2["Numpad8"] = 93] = "Numpad8";
|
|
138
|
+
Key2[Key2["Numpad9"] = 94] = "Numpad9";
|
|
139
|
+
Key2[Key2["NumpadAdd"] = 95] = "NumpadAdd";
|
|
140
|
+
Key2[Key2["NumpadBackspace"] = 96] = "NumpadBackspace";
|
|
141
|
+
Key2[Key2["NumpadClear"] = 97] = "NumpadClear";
|
|
142
|
+
Key2[Key2["NumpadClearEntry"] = 98] = "NumpadClearEntry";
|
|
143
|
+
Key2[Key2["NumpadComma"] = 99] = "NumpadComma";
|
|
144
|
+
Key2[Key2["NumpadDecimal"] = 100] = "NumpadDecimal";
|
|
145
|
+
Key2[Key2["NumpadDivide"] = 101] = "NumpadDivide";
|
|
146
|
+
Key2[Key2["NumpadEnter"] = 102] = "NumpadEnter";
|
|
147
|
+
Key2[Key2["NumpadEqual"] = 103] = "NumpadEqual";
|
|
148
|
+
Key2[Key2["NumpadHash"] = 104] = "NumpadHash";
|
|
149
|
+
Key2[Key2["NumpadMemoryAdd"] = 105] = "NumpadMemoryAdd";
|
|
150
|
+
Key2[Key2["NumpadMemoryClear"] = 106] = "NumpadMemoryClear";
|
|
151
|
+
Key2[Key2["NumpadMemoryRecall"] = 107] = "NumpadMemoryRecall";
|
|
152
|
+
Key2[Key2["NumpadMemoryStore"] = 108] = "NumpadMemoryStore";
|
|
153
|
+
Key2[Key2["NumpadMemorySubtract"] = 109] = "NumpadMemorySubtract";
|
|
154
|
+
Key2[Key2["NumpadMultiply"] = 110] = "NumpadMultiply";
|
|
155
|
+
Key2[Key2["NumpadParenLeft"] = 111] = "NumpadParenLeft";
|
|
156
|
+
Key2[Key2["NumpadParenRight"] = 112] = "NumpadParenRight";
|
|
157
|
+
Key2[Key2["NumpadStar"] = 113] = "NumpadStar";
|
|
158
|
+
Key2[Key2["NumpadSubtract"] = 114] = "NumpadSubtract";
|
|
159
|
+
Key2[Key2["Escape"] = 115] = "Escape";
|
|
160
|
+
Key2[Key2["Fn"] = 116] = "Fn";
|
|
161
|
+
Key2[Key2["FnLock"] = 117] = "FnLock";
|
|
162
|
+
Key2[Key2["PrintScreen"] = 118] = "PrintScreen";
|
|
163
|
+
Key2[Key2["ScrollLock"] = 119] = "ScrollLock";
|
|
164
|
+
Key2[Key2["Pause"] = 120] = "Pause";
|
|
165
|
+
Key2[Key2["BrowserBack"] = 121] = "BrowserBack";
|
|
166
|
+
Key2[Key2["BrowserFavorites"] = 122] = "BrowserFavorites";
|
|
167
|
+
Key2[Key2["BrowserForward"] = 123] = "BrowserForward";
|
|
168
|
+
Key2[Key2["BrowserHome"] = 124] = "BrowserHome";
|
|
169
|
+
Key2[Key2["BrowserRefresh"] = 125] = "BrowserRefresh";
|
|
170
|
+
Key2[Key2["BrowserSearch"] = 126] = "BrowserSearch";
|
|
171
|
+
Key2[Key2["BrowserStop"] = 127] = "BrowserStop";
|
|
172
|
+
Key2[Key2["Eject"] = 128] = "Eject";
|
|
173
|
+
Key2[Key2["LaunchApp1"] = 129] = "LaunchApp1";
|
|
174
|
+
Key2[Key2["LaunchApp2"] = 130] = "LaunchApp2";
|
|
175
|
+
Key2[Key2["LaunchMail"] = 131] = "LaunchMail";
|
|
176
|
+
Key2[Key2["MediaPlayPause"] = 132] = "MediaPlayPause";
|
|
177
|
+
Key2[Key2["MediaSelect"] = 133] = "MediaSelect";
|
|
178
|
+
Key2[Key2["MediaStop"] = 134] = "MediaStop";
|
|
179
|
+
Key2[Key2["MediaTrackNext"] = 135] = "MediaTrackNext";
|
|
180
|
+
Key2[Key2["MediaTrackPrevious"] = 136] = "MediaTrackPrevious";
|
|
181
|
+
Key2[Key2["Power"] = 137] = "Power";
|
|
182
|
+
Key2[Key2["Sleep"] = 138] = "Sleep";
|
|
183
|
+
Key2[Key2["AudioVolumeDown"] = 139] = "AudioVolumeDown";
|
|
184
|
+
Key2[Key2["AudioVolumeMute"] = 140] = "AudioVolumeMute";
|
|
185
|
+
Key2[Key2["AudioVolumeUp"] = 141] = "AudioVolumeUp";
|
|
186
|
+
Key2[Key2["WakeUp"] = 142] = "WakeUp";
|
|
187
|
+
Key2[Key2["Hyper"] = 143] = "Hyper";
|
|
188
|
+
Key2[Key2["Super"] = 144] = "Super";
|
|
189
|
+
Key2[Key2["Turbo"] = 145] = "Turbo";
|
|
190
|
+
Key2[Key2["Abort"] = 146] = "Abort";
|
|
191
|
+
Key2[Key2["Resume"] = 147] = "Resume";
|
|
192
|
+
Key2[Key2["Suspend"] = 148] = "Suspend";
|
|
193
|
+
Key2[Key2["Again"] = 149] = "Again";
|
|
194
|
+
Key2[Key2["Copy"] = 150] = "Copy";
|
|
195
|
+
Key2[Key2["Cut"] = 151] = "Cut";
|
|
196
|
+
Key2[Key2["Find"] = 152] = "Find";
|
|
197
|
+
Key2[Key2["Open"] = 153] = "Open";
|
|
198
|
+
Key2[Key2["Paste"] = 154] = "Paste";
|
|
199
|
+
Key2[Key2["Props"] = 155] = "Props";
|
|
200
|
+
Key2[Key2["Select"] = 156] = "Select";
|
|
201
|
+
Key2[Key2["Undo"] = 157] = "Undo";
|
|
202
|
+
Key2[Key2["Hiragana"] = 158] = "Hiragana";
|
|
203
|
+
Key2[Key2["Katakana"] = 159] = "Katakana";
|
|
204
|
+
Key2[Key2["F1"] = 160] = "F1";
|
|
205
|
+
Key2[Key2["F2"] = 161] = "F2";
|
|
206
|
+
Key2[Key2["F3"] = 162] = "F3";
|
|
207
|
+
Key2[Key2["F4"] = 163] = "F4";
|
|
208
|
+
Key2[Key2["F5"] = 164] = "F5";
|
|
209
|
+
Key2[Key2["F6"] = 165] = "F6";
|
|
210
|
+
Key2[Key2["F7"] = 166] = "F7";
|
|
211
|
+
Key2[Key2["F8"] = 167] = "F8";
|
|
212
|
+
Key2[Key2["F9"] = 168] = "F9";
|
|
213
|
+
Key2[Key2["F10"] = 169] = "F10";
|
|
214
|
+
Key2[Key2["F11"] = 170] = "F11";
|
|
215
|
+
Key2[Key2["F12"] = 171] = "F12";
|
|
216
|
+
Key2[Key2["F13"] = 172] = "F13";
|
|
217
|
+
Key2[Key2["F14"] = 173] = "F14";
|
|
218
|
+
Key2[Key2["F15"] = 174] = "F15";
|
|
219
|
+
Key2[Key2["F16"] = 175] = "F16";
|
|
220
|
+
Key2[Key2["F17"] = 176] = "F17";
|
|
221
|
+
Key2[Key2["F18"] = 177] = "F18";
|
|
222
|
+
Key2[Key2["F19"] = 178] = "F19";
|
|
223
|
+
Key2[Key2["F20"] = 179] = "F20";
|
|
224
|
+
Key2[Key2["F21"] = 180] = "F21";
|
|
225
|
+
Key2[Key2["F22"] = 181] = "F22";
|
|
226
|
+
Key2[Key2["F23"] = 182] = "F23";
|
|
227
|
+
Key2[Key2["F24"] = 183] = "F24";
|
|
228
|
+
Key2[Key2["F25"] = 184] = "F25";
|
|
229
|
+
Key2[Key2["F26"] = 185] = "F26";
|
|
230
|
+
Key2[Key2["F27"] = 186] = "F27";
|
|
231
|
+
Key2[Key2["F28"] = 187] = "F28";
|
|
232
|
+
Key2[Key2["F29"] = 188] = "F29";
|
|
233
|
+
Key2[Key2["F30"] = 189] = "F30";
|
|
234
|
+
Key2[Key2["F31"] = 190] = "F31";
|
|
235
|
+
Key2[Key2["F32"] = 191] = "F32";
|
|
236
|
+
Key2[Key2["F33"] = 192] = "F33";
|
|
237
|
+
Key2[Key2["F34"] = 193] = "F34";
|
|
238
|
+
Key2[Key2["F35"] = 194] = "F35";
|
|
239
|
+
})(Key ||= {});
|
|
109
240
|
// js/inputs.ts
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
MouseButtonCode: () => MouseButtonCode,
|
|
116
|
-
KeyboardSnapshot: () => KeyboardSnapshot,
|
|
117
|
-
KeyCode: () => KeyCode,
|
|
118
|
-
InputSnapshot: () => InputSnapshot
|
|
119
|
-
});
|
|
120
|
-
var KeyCode;
|
|
121
|
-
((KeyCode2) => {
|
|
122
|
-
KeyCode2[KeyCode2["Backquote"] = 0] = "Backquote";
|
|
123
|
-
KeyCode2[KeyCode2["Backslash"] = 1] = "Backslash";
|
|
124
|
-
KeyCode2[KeyCode2["BracketLeft"] = 2] = "BracketLeft";
|
|
125
|
-
KeyCode2[KeyCode2["BracketRight"] = 3] = "BracketRight";
|
|
126
|
-
KeyCode2[KeyCode2["Comma"] = 4] = "Comma";
|
|
127
|
-
KeyCode2[KeyCode2["Digit0"] = 5] = "Digit0";
|
|
128
|
-
KeyCode2[KeyCode2["Digit1"] = 6] = "Digit1";
|
|
129
|
-
KeyCode2[KeyCode2["Digit2"] = 7] = "Digit2";
|
|
130
|
-
KeyCode2[KeyCode2["Digit3"] = 8] = "Digit3";
|
|
131
|
-
KeyCode2[KeyCode2["Digit4"] = 9] = "Digit4";
|
|
132
|
-
KeyCode2[KeyCode2["Digit5"] = 10] = "Digit5";
|
|
133
|
-
KeyCode2[KeyCode2["Digit6"] = 11] = "Digit6";
|
|
134
|
-
KeyCode2[KeyCode2["Digit7"] = 12] = "Digit7";
|
|
135
|
-
KeyCode2[KeyCode2["Digit8"] = 13] = "Digit8";
|
|
136
|
-
KeyCode2[KeyCode2["Digit9"] = 14] = "Digit9";
|
|
137
|
-
KeyCode2[KeyCode2["Equal"] = 15] = "Equal";
|
|
138
|
-
KeyCode2[KeyCode2["IntlBackslash"] = 16] = "IntlBackslash";
|
|
139
|
-
KeyCode2[KeyCode2["IntlRo"] = 17] = "IntlRo";
|
|
140
|
-
KeyCode2[KeyCode2["IntlYen"] = 18] = "IntlYen";
|
|
141
|
-
KeyCode2[KeyCode2["KeyA"] = 19] = "KeyA";
|
|
142
|
-
KeyCode2[KeyCode2["KeyB"] = 20] = "KeyB";
|
|
143
|
-
KeyCode2[KeyCode2["KeyC"] = 21] = "KeyC";
|
|
144
|
-
KeyCode2[KeyCode2["KeyD"] = 22] = "KeyD";
|
|
145
|
-
KeyCode2[KeyCode2["KeyE"] = 23] = "KeyE";
|
|
146
|
-
KeyCode2[KeyCode2["KeyF"] = 24] = "KeyF";
|
|
147
|
-
KeyCode2[KeyCode2["KeyG"] = 25] = "KeyG";
|
|
148
|
-
KeyCode2[KeyCode2["KeyH"] = 26] = "KeyH";
|
|
149
|
-
KeyCode2[KeyCode2["KeyI"] = 27] = "KeyI";
|
|
150
|
-
KeyCode2[KeyCode2["KeyJ"] = 28] = "KeyJ";
|
|
151
|
-
KeyCode2[KeyCode2["KeyK"] = 29] = "KeyK";
|
|
152
|
-
KeyCode2[KeyCode2["KeyL"] = 30] = "KeyL";
|
|
153
|
-
KeyCode2[KeyCode2["KeyM"] = 31] = "KeyM";
|
|
154
|
-
KeyCode2[KeyCode2["KeyN"] = 32] = "KeyN";
|
|
155
|
-
KeyCode2[KeyCode2["KeyO"] = 33] = "KeyO";
|
|
156
|
-
KeyCode2[KeyCode2["KeyP"] = 34] = "KeyP";
|
|
157
|
-
KeyCode2[KeyCode2["KeyQ"] = 35] = "KeyQ";
|
|
158
|
-
KeyCode2[KeyCode2["KeyR"] = 36] = "KeyR";
|
|
159
|
-
KeyCode2[KeyCode2["KeyS"] = 37] = "KeyS";
|
|
160
|
-
KeyCode2[KeyCode2["KeyT"] = 38] = "KeyT";
|
|
161
|
-
KeyCode2[KeyCode2["KeyU"] = 39] = "KeyU";
|
|
162
|
-
KeyCode2[KeyCode2["KeyV"] = 40] = "KeyV";
|
|
163
|
-
KeyCode2[KeyCode2["KeyW"] = 41] = "KeyW";
|
|
164
|
-
KeyCode2[KeyCode2["KeyX"] = 42] = "KeyX";
|
|
165
|
-
KeyCode2[KeyCode2["KeyY"] = 43] = "KeyY";
|
|
166
|
-
KeyCode2[KeyCode2["KeyZ"] = 44] = "KeyZ";
|
|
167
|
-
KeyCode2[KeyCode2["Minus"] = 45] = "Minus";
|
|
168
|
-
KeyCode2[KeyCode2["Period"] = 46] = "Period";
|
|
169
|
-
KeyCode2[KeyCode2["Quote"] = 47] = "Quote";
|
|
170
|
-
KeyCode2[KeyCode2["Semicolon"] = 48] = "Semicolon";
|
|
171
|
-
KeyCode2[KeyCode2["Slash"] = 49] = "Slash";
|
|
172
|
-
KeyCode2[KeyCode2["AltLeft"] = 50] = "AltLeft";
|
|
173
|
-
KeyCode2[KeyCode2["AltRight"] = 51] = "AltRight";
|
|
174
|
-
KeyCode2[KeyCode2["Backspace"] = 52] = "Backspace";
|
|
175
|
-
KeyCode2[KeyCode2["CapsLock"] = 53] = "CapsLock";
|
|
176
|
-
KeyCode2[KeyCode2["ContextMenu"] = 54] = "ContextMenu";
|
|
177
|
-
KeyCode2[KeyCode2["ControlLeft"] = 55] = "ControlLeft";
|
|
178
|
-
KeyCode2[KeyCode2["ControlRight"] = 56] = "ControlRight";
|
|
179
|
-
KeyCode2[KeyCode2["Enter"] = 57] = "Enter";
|
|
180
|
-
KeyCode2[KeyCode2["MetaLeft"] = 58] = "MetaLeft";
|
|
181
|
-
KeyCode2[KeyCode2["MetaRight"] = 59] = "MetaRight";
|
|
182
|
-
KeyCode2[KeyCode2["ShiftLeft"] = 60] = "ShiftLeft";
|
|
183
|
-
KeyCode2[KeyCode2["ShiftRight"] = 61] = "ShiftRight";
|
|
184
|
-
KeyCode2[KeyCode2["Space"] = 62] = "Space";
|
|
185
|
-
KeyCode2[KeyCode2["Tab"] = 63] = "Tab";
|
|
186
|
-
KeyCode2[KeyCode2["Convert"] = 64] = "Convert";
|
|
187
|
-
KeyCode2[KeyCode2["KanaMode"] = 65] = "KanaMode";
|
|
188
|
-
KeyCode2[KeyCode2["Lang1"] = 66] = "Lang1";
|
|
189
|
-
KeyCode2[KeyCode2["Lang2"] = 67] = "Lang2";
|
|
190
|
-
KeyCode2[KeyCode2["Lang3"] = 68] = "Lang3";
|
|
191
|
-
KeyCode2[KeyCode2["Lang4"] = 69] = "Lang4";
|
|
192
|
-
KeyCode2[KeyCode2["Lang5"] = 70] = "Lang5";
|
|
193
|
-
KeyCode2[KeyCode2["NonConvert"] = 71] = "NonConvert";
|
|
194
|
-
KeyCode2[KeyCode2["Delete"] = 72] = "Delete";
|
|
195
|
-
KeyCode2[KeyCode2["End"] = 73] = "End";
|
|
196
|
-
KeyCode2[KeyCode2["Help"] = 74] = "Help";
|
|
197
|
-
KeyCode2[KeyCode2["Home"] = 75] = "Home";
|
|
198
|
-
KeyCode2[KeyCode2["Insert"] = 76] = "Insert";
|
|
199
|
-
KeyCode2[KeyCode2["PageDown"] = 77] = "PageDown";
|
|
200
|
-
KeyCode2[KeyCode2["PageUp"] = 78] = "PageUp";
|
|
201
|
-
KeyCode2[KeyCode2["ArrowDown"] = 79] = "ArrowDown";
|
|
202
|
-
KeyCode2[KeyCode2["ArrowLeft"] = 80] = "ArrowLeft";
|
|
203
|
-
KeyCode2[KeyCode2["ArrowRight"] = 81] = "ArrowRight";
|
|
204
|
-
KeyCode2[KeyCode2["ArrowUp"] = 82] = "ArrowUp";
|
|
205
|
-
KeyCode2[KeyCode2["NumLock"] = 83] = "NumLock";
|
|
206
|
-
KeyCode2[KeyCode2["Numpad0"] = 84] = "Numpad0";
|
|
207
|
-
KeyCode2[KeyCode2["Numpad1"] = 85] = "Numpad1";
|
|
208
|
-
KeyCode2[KeyCode2["Numpad2"] = 86] = "Numpad2";
|
|
209
|
-
KeyCode2[KeyCode2["Numpad3"] = 87] = "Numpad3";
|
|
210
|
-
KeyCode2[KeyCode2["Numpad4"] = 88] = "Numpad4";
|
|
211
|
-
KeyCode2[KeyCode2["Numpad5"] = 89] = "Numpad5";
|
|
212
|
-
KeyCode2[KeyCode2["Numpad6"] = 90] = "Numpad6";
|
|
213
|
-
KeyCode2[KeyCode2["Numpad7"] = 91] = "Numpad7";
|
|
214
|
-
KeyCode2[KeyCode2["Numpad8"] = 92] = "Numpad8";
|
|
215
|
-
KeyCode2[KeyCode2["Numpad9"] = 93] = "Numpad9";
|
|
216
|
-
KeyCode2[KeyCode2["NumpadAdd"] = 94] = "NumpadAdd";
|
|
217
|
-
KeyCode2[KeyCode2["NumpadBackspace"] = 95] = "NumpadBackspace";
|
|
218
|
-
KeyCode2[KeyCode2["NumpadClear"] = 96] = "NumpadClear";
|
|
219
|
-
KeyCode2[KeyCode2["NumpadClearEntry"] = 97] = "NumpadClearEntry";
|
|
220
|
-
KeyCode2[KeyCode2["NumpadComma"] = 98] = "NumpadComma";
|
|
221
|
-
KeyCode2[KeyCode2["NumpadDecimal"] = 99] = "NumpadDecimal";
|
|
222
|
-
KeyCode2[KeyCode2["NumpadDivide"] = 100] = "NumpadDivide";
|
|
223
|
-
KeyCode2[KeyCode2["NumpadEnter"] = 101] = "NumpadEnter";
|
|
224
|
-
KeyCode2[KeyCode2["NumpadEqual"] = 102] = "NumpadEqual";
|
|
225
|
-
KeyCode2[KeyCode2["NumpadHash"] = 103] = "NumpadHash";
|
|
226
|
-
KeyCode2[KeyCode2["NumpadMemoryAdd"] = 104] = "NumpadMemoryAdd";
|
|
227
|
-
KeyCode2[KeyCode2["NumpadMemoryClear"] = 105] = "NumpadMemoryClear";
|
|
228
|
-
KeyCode2[KeyCode2["NumpadMemoryRecall"] = 106] = "NumpadMemoryRecall";
|
|
229
|
-
KeyCode2[KeyCode2["NumpadMemoryStore"] = 107] = "NumpadMemoryStore";
|
|
230
|
-
KeyCode2[KeyCode2["NumpadMemorySubtract"] = 108] = "NumpadMemorySubtract";
|
|
231
|
-
KeyCode2[KeyCode2["NumpadMultiply"] = 109] = "NumpadMultiply";
|
|
232
|
-
KeyCode2[KeyCode2["NumpadParenLeft"] = 110] = "NumpadParenLeft";
|
|
233
|
-
KeyCode2[KeyCode2["NumpadParenRight"] = 111] = "NumpadParenRight";
|
|
234
|
-
KeyCode2[KeyCode2["NumpadStar"] = 112] = "NumpadStar";
|
|
235
|
-
KeyCode2[KeyCode2["NumpadSubtract"] = 113] = "NumpadSubtract";
|
|
236
|
-
KeyCode2[KeyCode2["Escape"] = 114] = "Escape";
|
|
237
|
-
KeyCode2[KeyCode2["Fn"] = 115] = "Fn";
|
|
238
|
-
KeyCode2[KeyCode2["FnLock"] = 116] = "FnLock";
|
|
239
|
-
KeyCode2[KeyCode2["PrintScreen"] = 117] = "PrintScreen";
|
|
240
|
-
KeyCode2[KeyCode2["ScrollLock"] = 118] = "ScrollLock";
|
|
241
|
-
KeyCode2[KeyCode2["Pause"] = 119] = "Pause";
|
|
242
|
-
KeyCode2[KeyCode2["BrowserBack"] = 120] = "BrowserBack";
|
|
243
|
-
KeyCode2[KeyCode2["BrowserFavorites"] = 121] = "BrowserFavorites";
|
|
244
|
-
KeyCode2[KeyCode2["BrowserForward"] = 122] = "BrowserForward";
|
|
245
|
-
KeyCode2[KeyCode2["BrowserHome"] = 123] = "BrowserHome";
|
|
246
|
-
KeyCode2[KeyCode2["BrowserRefresh"] = 124] = "BrowserRefresh";
|
|
247
|
-
KeyCode2[KeyCode2["BrowserSearch"] = 125] = "BrowserSearch";
|
|
248
|
-
KeyCode2[KeyCode2["BrowserStop"] = 126] = "BrowserStop";
|
|
249
|
-
KeyCode2[KeyCode2["Eject"] = 127] = "Eject";
|
|
250
|
-
KeyCode2[KeyCode2["LaunchApp1"] = 128] = "LaunchApp1";
|
|
251
|
-
KeyCode2[KeyCode2["LaunchApp2"] = 129] = "LaunchApp2";
|
|
252
|
-
KeyCode2[KeyCode2["LaunchMail"] = 130] = "LaunchMail";
|
|
253
|
-
KeyCode2[KeyCode2["MediaPlayPause"] = 131] = "MediaPlayPause";
|
|
254
|
-
KeyCode2[KeyCode2["MediaSelect"] = 132] = "MediaSelect";
|
|
255
|
-
KeyCode2[KeyCode2["MediaStop"] = 133] = "MediaStop";
|
|
256
|
-
KeyCode2[KeyCode2["MediaTrackNext"] = 134] = "MediaTrackNext";
|
|
257
|
-
KeyCode2[KeyCode2["MediaTrackPrevious"] = 135] = "MediaTrackPrevious";
|
|
258
|
-
KeyCode2[KeyCode2["Power"] = 136] = "Power";
|
|
259
|
-
KeyCode2[KeyCode2["Sleep"] = 137] = "Sleep";
|
|
260
|
-
KeyCode2[KeyCode2["AudioVolumeDown"] = 138] = "AudioVolumeDown";
|
|
261
|
-
KeyCode2[KeyCode2["AudioVolumeMute"] = 139] = "AudioVolumeMute";
|
|
262
|
-
KeyCode2[KeyCode2["AudioVolumeUp"] = 140] = "AudioVolumeUp";
|
|
263
|
-
KeyCode2[KeyCode2["WakeUp"] = 141] = "WakeUp";
|
|
264
|
-
KeyCode2[KeyCode2["Hyper"] = 142] = "Hyper";
|
|
265
|
-
KeyCode2[KeyCode2["Super"] = 143] = "Super";
|
|
266
|
-
KeyCode2[KeyCode2["Turbo"] = 144] = "Turbo";
|
|
267
|
-
KeyCode2[KeyCode2["Abort"] = 145] = "Abort";
|
|
268
|
-
KeyCode2[KeyCode2["Resume"] = 146] = "Resume";
|
|
269
|
-
KeyCode2[KeyCode2["Suspend"] = 147] = "Suspend";
|
|
270
|
-
KeyCode2[KeyCode2["Again"] = 148] = "Again";
|
|
271
|
-
KeyCode2[KeyCode2["Copy"] = 149] = "Copy";
|
|
272
|
-
KeyCode2[KeyCode2["Cut"] = 150] = "Cut";
|
|
273
|
-
KeyCode2[KeyCode2["Find"] = 151] = "Find";
|
|
274
|
-
KeyCode2[KeyCode2["Open"] = 152] = "Open";
|
|
275
|
-
KeyCode2[KeyCode2["Paste"] = 153] = "Paste";
|
|
276
|
-
KeyCode2[KeyCode2["Props"] = 154] = "Props";
|
|
277
|
-
KeyCode2[KeyCode2["Select"] = 155] = "Select";
|
|
278
|
-
KeyCode2[KeyCode2["Undo"] = 156] = "Undo";
|
|
279
|
-
KeyCode2[KeyCode2["Hiragana"] = 157] = "Hiragana";
|
|
280
|
-
KeyCode2[KeyCode2["Katakana"] = 158] = "Katakana";
|
|
281
|
-
KeyCode2[KeyCode2["F1"] = 159] = "F1";
|
|
282
|
-
KeyCode2[KeyCode2["F2"] = 160] = "F2";
|
|
283
|
-
KeyCode2[KeyCode2["F3"] = 161] = "F3";
|
|
284
|
-
KeyCode2[KeyCode2["F4"] = 162] = "F4";
|
|
285
|
-
KeyCode2[KeyCode2["F5"] = 163] = "F5";
|
|
286
|
-
KeyCode2[KeyCode2["F6"] = 164] = "F6";
|
|
287
|
-
KeyCode2[KeyCode2["F7"] = 165] = "F7";
|
|
288
|
-
KeyCode2[KeyCode2["F8"] = 166] = "F8";
|
|
289
|
-
KeyCode2[KeyCode2["F9"] = 167] = "F9";
|
|
290
|
-
KeyCode2[KeyCode2["F10"] = 168] = "F10";
|
|
291
|
-
KeyCode2[KeyCode2["F11"] = 169] = "F11";
|
|
292
|
-
KeyCode2[KeyCode2["F12"] = 170] = "F12";
|
|
293
|
-
KeyCode2[KeyCode2["F13"] = 171] = "F13";
|
|
294
|
-
KeyCode2[KeyCode2["F14"] = 172] = "F14";
|
|
295
|
-
KeyCode2[KeyCode2["F15"] = 173] = "F15";
|
|
296
|
-
KeyCode2[KeyCode2["F16"] = 174] = "F16";
|
|
297
|
-
KeyCode2[KeyCode2["F17"] = 175] = "F17";
|
|
298
|
-
KeyCode2[KeyCode2["F18"] = 176] = "F18";
|
|
299
|
-
KeyCode2[KeyCode2["F19"] = 177] = "F19";
|
|
300
|
-
KeyCode2[KeyCode2["F20"] = 178] = "F20";
|
|
301
|
-
KeyCode2[KeyCode2["F21"] = 179] = "F21";
|
|
302
|
-
KeyCode2[KeyCode2["F22"] = 180] = "F22";
|
|
303
|
-
KeyCode2[KeyCode2["F23"] = 181] = "F23";
|
|
304
|
-
KeyCode2[KeyCode2["F24"] = 182] = "F24";
|
|
305
|
-
KeyCode2[KeyCode2["F25"] = 183] = "F25";
|
|
306
|
-
KeyCode2[KeyCode2["F26"] = 184] = "F26";
|
|
307
|
-
KeyCode2[KeyCode2["F27"] = 185] = "F27";
|
|
308
|
-
KeyCode2[KeyCode2["F28"] = 186] = "F28";
|
|
309
|
-
KeyCode2[KeyCode2["F29"] = 187] = "F29";
|
|
310
|
-
KeyCode2[KeyCode2["F30"] = 188] = "F30";
|
|
311
|
-
KeyCode2[KeyCode2["F31"] = 189] = "F31";
|
|
312
|
-
KeyCode2[KeyCode2["F32"] = 190] = "F32";
|
|
313
|
-
KeyCode2[KeyCode2["F33"] = 191] = "F33";
|
|
314
|
-
KeyCode2[KeyCode2["F34"] = 192] = "F34";
|
|
315
|
-
KeyCode2[KeyCode2["F35"] = 193] = "F35";
|
|
316
|
-
})(KeyCode ||= {});
|
|
317
|
-
var MouseButtonCode;
|
|
318
|
-
((MouseButtonCode2) => {
|
|
319
|
-
MouseButtonCode2[MouseButtonCode2["Left"] = 0] = "Left";
|
|
320
|
-
MouseButtonCode2[MouseButtonCode2["Middle"] = 1] = "Middle";
|
|
321
|
-
MouseButtonCode2[MouseButtonCode2["Right"] = 2] = "Right";
|
|
322
|
-
MouseButtonCode2[MouseButtonCode2["X1"] = 3] = "X1";
|
|
323
|
-
MouseButtonCode2[MouseButtonCode2["X2"] = 4] = "X2";
|
|
324
|
-
MouseButtonCode2[MouseButtonCode2["X3"] = 5] = "X3";
|
|
325
|
-
MouseButtonCode2[MouseButtonCode2["X4"] = 6] = "X4";
|
|
326
|
-
MouseButtonCode2[MouseButtonCode2["X5"] = 7] = "X5";
|
|
327
|
-
})(MouseButtonCode ||= {});
|
|
241
|
+
var MOUSE_OFFSET = 256;
|
|
242
|
+
var MOUSE_BUTTONS_OFFSET = 16;
|
|
243
|
+
var KEYBOARD_OFFSET = 0;
|
|
244
|
+
var EVENT_PAYLOAD_SIZE = 8;
|
|
245
|
+
var EVENT_PAYLOAD_ALIGN = 4;
|
|
328
246
|
function keyToKeyCode(key) {
|
|
329
|
-
return
|
|
247
|
+
return Key[key];
|
|
248
|
+
}
|
|
249
|
+
function keyCodeToKey(code) {
|
|
250
|
+
return Key[code];
|
|
330
251
|
}
|
|
331
252
|
function mouseButtonToMouseButtonCode(button) {
|
|
332
|
-
return
|
|
253
|
+
return MouseButton[button];
|
|
254
|
+
}
|
|
255
|
+
function mouseButtonCodeToMouseButton(code) {
|
|
256
|
+
return MouseButton[code];
|
|
333
257
|
}
|
|
334
|
-
var keysLength = Object.keys(KeyCode).length / 2;
|
|
335
258
|
|
|
336
|
-
|
|
259
|
+
// js/contexts/inputContext.ts
|
|
260
|
+
class InputContext {
|
|
337
261
|
#dataView;
|
|
338
|
-
keys;
|
|
339
|
-
mouse;
|
|
262
|
+
#keys;
|
|
263
|
+
#mouse;
|
|
340
264
|
constructor(dataView) {
|
|
265
|
+
if (dataView) {
|
|
266
|
+
this.#dataView = dataView;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
get dataView() {
|
|
270
|
+
if (!this.#dataView) {
|
|
271
|
+
throw new Error("DataView is not initialized on InputContext");
|
|
272
|
+
}
|
|
273
|
+
return this.#dataView;
|
|
274
|
+
}
|
|
275
|
+
set dataView(dataView) {
|
|
341
276
|
this.#dataView = dataView;
|
|
342
|
-
this
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
switch (event.type) {
|
|
349
|
-
case "keydown":
|
|
350
|
-
case "keyup":
|
|
351
|
-
this.keys.update(event);
|
|
352
|
-
break;
|
|
353
|
-
case "mousemove":
|
|
354
|
-
case "mousedown":
|
|
355
|
-
case "mouseup":
|
|
356
|
-
case "mousewheel":
|
|
357
|
-
this.mouse.update(event);
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
277
|
+
this.#keys = undefined;
|
|
278
|
+
this.#mouse = undefined;
|
|
279
|
+
}
|
|
280
|
+
get keys() {
|
|
281
|
+
if (!this.#keys) {
|
|
282
|
+
this.#keys = new KeyboardContext(new DataView(this.dataView.buffer, this.dataView.byteOffset + KEYBOARD_OFFSET));
|
|
360
283
|
}
|
|
284
|
+
return this.#keys;
|
|
361
285
|
}
|
|
362
|
-
|
|
363
|
-
this
|
|
364
|
-
|
|
286
|
+
get mouse() {
|
|
287
|
+
if (!this.#mouse) {
|
|
288
|
+
this.#mouse = new MouseContext(new DataView(this.dataView.buffer, this.dataView.byteOffset + MOUSE_OFFSET));
|
|
289
|
+
}
|
|
290
|
+
return this.#mouse;
|
|
365
291
|
}
|
|
366
292
|
}
|
|
367
293
|
|
|
368
|
-
class
|
|
369
|
-
x = 0;
|
|
370
|
-
y = 0;
|
|
371
|
-
wheel = { x: 0, y: 0 };
|
|
372
|
-
left = { down: false, held: false, up: false };
|
|
373
|
-
middle = { down: false, held: false, up: false };
|
|
374
|
-
right = { down: false, held: false, up: false };
|
|
294
|
+
class MouseContext {
|
|
375
295
|
#dataView;
|
|
376
|
-
#
|
|
377
|
-
constructor(dataView
|
|
296
|
+
#buttonStates = new Map;
|
|
297
|
+
constructor(dataView) {
|
|
378
298
|
this.#dataView = dataView;
|
|
379
|
-
this.#offset = offset;
|
|
380
|
-
}
|
|
381
|
-
update(event) {
|
|
382
|
-
switch (event.type) {
|
|
383
|
-
case "mousemove":
|
|
384
|
-
this.x = event.x;
|
|
385
|
-
this.y = event.y;
|
|
386
|
-
break;
|
|
387
|
-
case "mousedown":
|
|
388
|
-
if (event.button === "Left") {
|
|
389
|
-
this.left.down = true;
|
|
390
|
-
this.left.held = true;
|
|
391
|
-
this.left.up = false;
|
|
392
|
-
}
|
|
393
|
-
if (event.button === "Middle") {
|
|
394
|
-
this.middle.down = true;
|
|
395
|
-
this.middle.held = true;
|
|
396
|
-
this.middle.up = false;
|
|
397
|
-
}
|
|
398
|
-
if (event.button === "Right") {
|
|
399
|
-
this.right.down = true;
|
|
400
|
-
this.right.held = true;
|
|
401
|
-
this.right.up = false;
|
|
402
|
-
}
|
|
403
|
-
break;
|
|
404
|
-
case "mouseup":
|
|
405
|
-
if (event.button === "Left") {
|
|
406
|
-
this.left.down = false;
|
|
407
|
-
this.left.held = false;
|
|
408
|
-
this.left.up = true;
|
|
409
|
-
}
|
|
410
|
-
if (event.button === "Middle") {
|
|
411
|
-
this.middle.down = false;
|
|
412
|
-
this.middle.held = false;
|
|
413
|
-
this.middle.up = true;
|
|
414
|
-
}
|
|
415
|
-
if (event.button === "Right") {
|
|
416
|
-
this.right.down = false;
|
|
417
|
-
this.right.held = false;
|
|
418
|
-
this.right.up = true;
|
|
419
|
-
}
|
|
420
|
-
break;
|
|
421
|
-
case "mousewheel":
|
|
422
|
-
this.wheel.x = event.x;
|
|
423
|
-
this.wheel.y = event.y;
|
|
424
|
-
break;
|
|
425
|
-
}
|
|
426
299
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
300
|
+
get x() {
|
|
301
|
+
return this.#dataView.getFloat32(0, true);
|
|
302
|
+
}
|
|
303
|
+
get y() {
|
|
304
|
+
return this.#dataView.getFloat32(4, true);
|
|
305
|
+
}
|
|
306
|
+
get wheel() {
|
|
307
|
+
return { x: this.wheelX, y: this.wheelY };
|
|
308
|
+
}
|
|
309
|
+
get wheelX() {
|
|
310
|
+
return this.#dataView.getFloat32(8, true);
|
|
311
|
+
}
|
|
312
|
+
get wheelY() {
|
|
313
|
+
return this.#dataView.getFloat32(12, true);
|
|
314
|
+
}
|
|
315
|
+
get left() {
|
|
316
|
+
return this.#buttonState(1 /* Left */);
|
|
317
|
+
}
|
|
318
|
+
get right() {
|
|
319
|
+
return this.#buttonState(3 /* Right */);
|
|
320
|
+
}
|
|
321
|
+
get middle() {
|
|
322
|
+
return this.#buttonState(2 /* Middle */);
|
|
323
|
+
}
|
|
324
|
+
#buttonState(code) {
|
|
325
|
+
let state;
|
|
326
|
+
if (this.#buttonStates.has(code)) {
|
|
327
|
+
state = this.#buttonStates.get(code);
|
|
328
|
+
} else {
|
|
329
|
+
state = { down: false, held: false, up: false };
|
|
330
|
+
this.#buttonStates.set(code, state);
|
|
331
|
+
}
|
|
332
|
+
const offset = MOUSE_BUTTONS_OFFSET;
|
|
333
|
+
state.held = !!(this.#dataView.getUint8(offset + code) & 1);
|
|
334
|
+
state.down = state.held && !(this.#dataView.getUint8(offset + code) & 2);
|
|
335
|
+
state.up = !state.held && !!(this.#dataView.getUint8(offset + code) & 2);
|
|
336
|
+
return state;
|
|
430
337
|
}
|
|
431
338
|
}
|
|
432
339
|
|
|
433
|
-
class
|
|
340
|
+
class KeyboardContext {
|
|
434
341
|
#dataView;
|
|
435
|
-
#offset;
|
|
436
342
|
#keystates = new Map;
|
|
437
343
|
constructor(dataView) {
|
|
438
344
|
this.#dataView = dataView;
|
|
439
|
-
this.#offset = 0;
|
|
440
|
-
}
|
|
441
|
-
update(event) {
|
|
442
|
-
switch (event.type) {
|
|
443
|
-
case "keyup": {
|
|
444
|
-
const keyCode = keyToKeyCode(event.key);
|
|
445
|
-
const keystate = this.#keystate(keyCode);
|
|
446
|
-
keystate.down = false;
|
|
447
|
-
keystate.held = false;
|
|
448
|
-
keystate.up = true;
|
|
449
|
-
break;
|
|
450
|
-
}
|
|
451
|
-
case "keydown": {
|
|
452
|
-
const keyCode = keyToKeyCode(event.key);
|
|
453
|
-
const keystate = this.#keystate(keyCode);
|
|
454
|
-
keystate.down = true;
|
|
455
|
-
keystate.held = true;
|
|
456
|
-
keystate.up = false;
|
|
457
|
-
break;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
flush() {
|
|
462
|
-
for (const [, state] of this.#keystates) {
|
|
463
|
-
state.down = false;
|
|
464
|
-
state.up = false;
|
|
465
|
-
}
|
|
466
345
|
}
|
|
467
346
|
get shift() {
|
|
468
347
|
return this.shiftLeft || this.shiftRight;
|
|
@@ -477,709 +356,658 @@ class KeyboardSnapshot {
|
|
|
477
356
|
return this.metaLeft || this.metaRight;
|
|
478
357
|
}
|
|
479
358
|
get backquote() {
|
|
480
|
-
return this.#keystate(
|
|
359
|
+
return this.#keystate(1 /* Backquote */);
|
|
481
360
|
}
|
|
482
361
|
get backslash() {
|
|
483
|
-
return this.#keystate(
|
|
362
|
+
return this.#keystate(2 /* Backslash */);
|
|
484
363
|
}
|
|
485
364
|
get bracketLeft() {
|
|
486
|
-
return this.#keystate(
|
|
365
|
+
return this.#keystate(3 /* BracketLeft */);
|
|
487
366
|
}
|
|
488
367
|
get bracketRight() {
|
|
489
|
-
return this.#keystate(
|
|
368
|
+
return this.#keystate(4 /* BracketRight */);
|
|
490
369
|
}
|
|
491
370
|
get comma() {
|
|
492
|
-
return this.#keystate(
|
|
371
|
+
return this.#keystate(5 /* Comma */);
|
|
493
372
|
}
|
|
494
373
|
get digit0() {
|
|
495
|
-
return this.#keystate(
|
|
374
|
+
return this.#keystate(6 /* Digit0 */);
|
|
496
375
|
}
|
|
497
376
|
get digit1() {
|
|
498
|
-
return this.#keystate(
|
|
377
|
+
return this.#keystate(7 /* Digit1 */);
|
|
499
378
|
}
|
|
500
379
|
get digit2() {
|
|
501
|
-
return this.#keystate(
|
|
380
|
+
return this.#keystate(8 /* Digit2 */);
|
|
502
381
|
}
|
|
503
382
|
get digit3() {
|
|
504
|
-
return this.#keystate(
|
|
383
|
+
return this.#keystate(9 /* Digit3 */);
|
|
505
384
|
}
|
|
506
385
|
get digit4() {
|
|
507
|
-
return this.#keystate(
|
|
386
|
+
return this.#keystate(10 /* Digit4 */);
|
|
508
387
|
}
|
|
509
388
|
get digit5() {
|
|
510
|
-
return this.#keystate(
|
|
389
|
+
return this.#keystate(11 /* Digit5 */);
|
|
511
390
|
}
|
|
512
391
|
get digit6() {
|
|
513
|
-
return this.#keystate(
|
|
392
|
+
return this.#keystate(12 /* Digit6 */);
|
|
514
393
|
}
|
|
515
394
|
get digit7() {
|
|
516
|
-
return this.#keystate(
|
|
395
|
+
return this.#keystate(13 /* Digit7 */);
|
|
517
396
|
}
|
|
518
397
|
get digit8() {
|
|
519
|
-
return this.#keystate(
|
|
398
|
+
return this.#keystate(14 /* Digit8 */);
|
|
520
399
|
}
|
|
521
400
|
get digit9() {
|
|
522
|
-
return this.#keystate(
|
|
401
|
+
return this.#keystate(15 /* Digit9 */);
|
|
523
402
|
}
|
|
524
403
|
get equal() {
|
|
525
|
-
return this.#keystate(
|
|
404
|
+
return this.#keystate(16 /* Equal */);
|
|
526
405
|
}
|
|
527
406
|
get intlBackslash() {
|
|
528
|
-
return this.#keystate(
|
|
407
|
+
return this.#keystate(17 /* IntlBackslash */);
|
|
529
408
|
}
|
|
530
409
|
get intlRo() {
|
|
531
|
-
return this.#keystate(
|
|
410
|
+
return this.#keystate(18 /* IntlRo */);
|
|
532
411
|
}
|
|
533
412
|
get intlYen() {
|
|
534
|
-
return this.#keystate(
|
|
413
|
+
return this.#keystate(19 /* IntlYen */);
|
|
535
414
|
}
|
|
536
415
|
get a() {
|
|
537
|
-
return this.#keystate(
|
|
416
|
+
return this.#keystate(20 /* KeyA */);
|
|
538
417
|
}
|
|
539
418
|
get b() {
|
|
540
|
-
return this.#keystate(
|
|
419
|
+
return this.#keystate(21 /* KeyB */);
|
|
541
420
|
}
|
|
542
421
|
get c() {
|
|
543
|
-
return this.#keystate(
|
|
422
|
+
return this.#keystate(22 /* KeyC */);
|
|
544
423
|
}
|
|
545
424
|
get d() {
|
|
546
|
-
return this.#keystate(
|
|
425
|
+
return this.#keystate(23 /* KeyD */);
|
|
547
426
|
}
|
|
548
427
|
get e() {
|
|
549
|
-
return this.#keystate(
|
|
428
|
+
return this.#keystate(24 /* KeyE */);
|
|
550
429
|
}
|
|
551
430
|
get f() {
|
|
552
|
-
return this.#keystate(
|
|
431
|
+
return this.#keystate(25 /* KeyF */);
|
|
553
432
|
}
|
|
554
433
|
get g() {
|
|
555
|
-
return this.#keystate(
|
|
434
|
+
return this.#keystate(26 /* KeyG */);
|
|
556
435
|
}
|
|
557
436
|
get h() {
|
|
558
|
-
return this.#keystate(
|
|
437
|
+
return this.#keystate(27 /* KeyH */);
|
|
559
438
|
}
|
|
560
439
|
get i() {
|
|
561
|
-
return this.#keystate(
|
|
440
|
+
return this.#keystate(28 /* KeyI */);
|
|
562
441
|
}
|
|
563
442
|
get j() {
|
|
564
|
-
return this.#keystate(
|
|
443
|
+
return this.#keystate(29 /* KeyJ */);
|
|
565
444
|
}
|
|
566
445
|
get k() {
|
|
567
|
-
return this.#keystate(
|
|
446
|
+
return this.#keystate(30 /* KeyK */);
|
|
568
447
|
}
|
|
569
448
|
get l() {
|
|
570
|
-
return this.#keystate(
|
|
449
|
+
return this.#keystate(31 /* KeyL */);
|
|
571
450
|
}
|
|
572
451
|
get m() {
|
|
573
|
-
return this.#keystate(
|
|
452
|
+
return this.#keystate(32 /* KeyM */);
|
|
574
453
|
}
|
|
575
454
|
get n() {
|
|
576
|
-
return this.#keystate(
|
|
455
|
+
return this.#keystate(33 /* KeyN */);
|
|
577
456
|
}
|
|
578
457
|
get o() {
|
|
579
|
-
return this.#keystate(
|
|
458
|
+
return this.#keystate(34 /* KeyO */);
|
|
580
459
|
}
|
|
581
460
|
get p() {
|
|
582
|
-
return this.#keystate(
|
|
461
|
+
return this.#keystate(35 /* KeyP */);
|
|
583
462
|
}
|
|
584
463
|
get q() {
|
|
585
|
-
return this.#keystate(
|
|
464
|
+
return this.#keystate(36 /* KeyQ */);
|
|
586
465
|
}
|
|
587
466
|
get r() {
|
|
588
|
-
return this.#keystate(
|
|
467
|
+
return this.#keystate(37 /* KeyR */);
|
|
589
468
|
}
|
|
590
469
|
get s() {
|
|
591
|
-
return this.#keystate(
|
|
470
|
+
return this.#keystate(38 /* KeyS */);
|
|
592
471
|
}
|
|
593
472
|
get t() {
|
|
594
|
-
return this.#keystate(
|
|
473
|
+
return this.#keystate(39 /* KeyT */);
|
|
595
474
|
}
|
|
596
475
|
get u() {
|
|
597
|
-
return this.#keystate(
|
|
476
|
+
return this.#keystate(40 /* KeyU */);
|
|
598
477
|
}
|
|
599
478
|
get v() {
|
|
600
|
-
return this.#keystate(
|
|
479
|
+
return this.#keystate(41 /* KeyV */);
|
|
601
480
|
}
|
|
602
481
|
get w() {
|
|
603
|
-
return this.#keystate(
|
|
482
|
+
return this.#keystate(42 /* KeyW */);
|
|
604
483
|
}
|
|
605
484
|
get x() {
|
|
606
|
-
return this.#keystate(
|
|
485
|
+
return this.#keystate(43 /* KeyX */);
|
|
607
486
|
}
|
|
608
487
|
get y() {
|
|
609
|
-
return this.#keystate(
|
|
488
|
+
return this.#keystate(44 /* KeyY */);
|
|
610
489
|
}
|
|
611
490
|
get z() {
|
|
612
|
-
return this.#keystate(
|
|
491
|
+
return this.#keystate(45 /* KeyZ */);
|
|
613
492
|
}
|
|
614
493
|
get minus() {
|
|
615
|
-
return this.#keystate(
|
|
494
|
+
return this.#keystate(46 /* Minus */);
|
|
616
495
|
}
|
|
617
496
|
get period() {
|
|
618
|
-
return this.#keystate(
|
|
497
|
+
return this.#keystate(47 /* Period */);
|
|
619
498
|
}
|
|
620
499
|
get quote() {
|
|
621
|
-
return this.#keystate(
|
|
500
|
+
return this.#keystate(48 /* Quote */);
|
|
622
501
|
}
|
|
623
502
|
get semicolon() {
|
|
624
|
-
return this.#keystate(
|
|
503
|
+
return this.#keystate(49 /* Semicolon */);
|
|
625
504
|
}
|
|
626
505
|
get slash() {
|
|
627
|
-
return this.#keystate(
|
|
506
|
+
return this.#keystate(50 /* Slash */);
|
|
628
507
|
}
|
|
629
508
|
get altLeft() {
|
|
630
|
-
return this.#keystate(
|
|
509
|
+
return this.#keystate(51 /* AltLeft */);
|
|
631
510
|
}
|
|
632
511
|
get altRight() {
|
|
633
|
-
return this.#keystate(
|
|
512
|
+
return this.#keystate(52 /* AltRight */);
|
|
634
513
|
}
|
|
635
514
|
get backspace() {
|
|
636
|
-
return this.#keystate(
|
|
515
|
+
return this.#keystate(53 /* Backspace */);
|
|
637
516
|
}
|
|
638
517
|
get capsLock() {
|
|
639
|
-
return this.#keystate(
|
|
518
|
+
return this.#keystate(54 /* CapsLock */);
|
|
640
519
|
}
|
|
641
520
|
get contextMenu() {
|
|
642
|
-
return this.#keystate(
|
|
521
|
+
return this.#keystate(55 /* ContextMenu */);
|
|
643
522
|
}
|
|
644
523
|
get controlLeft() {
|
|
645
|
-
return this.#keystate(
|
|
524
|
+
return this.#keystate(56 /* ControlLeft */);
|
|
646
525
|
}
|
|
647
526
|
get controlRight() {
|
|
648
|
-
return this.#keystate(
|
|
527
|
+
return this.#keystate(57 /* ControlRight */);
|
|
649
528
|
}
|
|
650
529
|
get enter() {
|
|
651
|
-
return this.#keystate(
|
|
530
|
+
return this.#keystate(58 /* Enter */);
|
|
652
531
|
}
|
|
653
532
|
get metaLeft() {
|
|
654
|
-
return this.#keystate(
|
|
533
|
+
return this.#keystate(59 /* MetaLeft */);
|
|
655
534
|
}
|
|
656
535
|
get metaRight() {
|
|
657
|
-
return this.#keystate(
|
|
536
|
+
return this.#keystate(60 /* MetaRight */);
|
|
658
537
|
}
|
|
659
538
|
get shiftLeft() {
|
|
660
|
-
return this.#keystate(
|
|
539
|
+
return this.#keystate(61 /* ShiftLeft */);
|
|
661
540
|
}
|
|
662
541
|
get shiftRight() {
|
|
663
|
-
return this.#keystate(
|
|
542
|
+
return this.#keystate(62 /* ShiftRight */);
|
|
664
543
|
}
|
|
665
544
|
get space() {
|
|
666
|
-
return this.#keystate(
|
|
545
|
+
return this.#keystate(63 /* Space */);
|
|
667
546
|
}
|
|
668
547
|
get tab() {
|
|
669
|
-
return this.#keystate(
|
|
548
|
+
return this.#keystate(64 /* Tab */);
|
|
670
549
|
}
|
|
671
550
|
get convert() {
|
|
672
|
-
return this.#keystate(
|
|
551
|
+
return this.#keystate(65 /* Convert */);
|
|
673
552
|
}
|
|
674
553
|
get kanaMode() {
|
|
675
|
-
return this.#keystate(
|
|
554
|
+
return this.#keystate(66 /* KanaMode */);
|
|
676
555
|
}
|
|
677
556
|
get lang1() {
|
|
678
|
-
return this.#keystate(
|
|
557
|
+
return this.#keystate(67 /* Lang1 */);
|
|
679
558
|
}
|
|
680
559
|
get lang2() {
|
|
681
|
-
return this.#keystate(
|
|
560
|
+
return this.#keystate(68 /* Lang2 */);
|
|
682
561
|
}
|
|
683
562
|
get lang3() {
|
|
684
|
-
return this.#keystate(
|
|
563
|
+
return this.#keystate(69 /* Lang3 */);
|
|
685
564
|
}
|
|
686
565
|
get lang4() {
|
|
687
|
-
return this.#keystate(
|
|
566
|
+
return this.#keystate(70 /* Lang4 */);
|
|
688
567
|
}
|
|
689
568
|
get lang5() {
|
|
690
|
-
return this.#keystate(
|
|
569
|
+
return this.#keystate(71 /* Lang5 */);
|
|
691
570
|
}
|
|
692
571
|
get nonConvert() {
|
|
693
|
-
return this.#keystate(
|
|
572
|
+
return this.#keystate(72 /* NonConvert */);
|
|
694
573
|
}
|
|
695
574
|
get delete() {
|
|
696
|
-
return this.#keystate(
|
|
575
|
+
return this.#keystate(73 /* Delete */);
|
|
697
576
|
}
|
|
698
577
|
get end() {
|
|
699
|
-
return this.#keystate(
|
|
578
|
+
return this.#keystate(74 /* End */);
|
|
700
579
|
}
|
|
701
580
|
get help() {
|
|
702
|
-
return this.#keystate(
|
|
581
|
+
return this.#keystate(75 /* Help */);
|
|
703
582
|
}
|
|
704
583
|
get home() {
|
|
705
|
-
return this.#keystate(
|
|
584
|
+
return this.#keystate(76 /* Home */);
|
|
706
585
|
}
|
|
707
586
|
get insert() {
|
|
708
|
-
return this.#keystate(
|
|
587
|
+
return this.#keystate(77 /* Insert */);
|
|
709
588
|
}
|
|
710
589
|
get pageDown() {
|
|
711
|
-
return this.#keystate(
|
|
590
|
+
return this.#keystate(78 /* PageDown */);
|
|
712
591
|
}
|
|
713
592
|
get pageUp() {
|
|
714
|
-
return this.#keystate(
|
|
593
|
+
return this.#keystate(79 /* PageUp */);
|
|
715
594
|
}
|
|
716
595
|
get arrowDown() {
|
|
717
|
-
return this.#keystate(
|
|
596
|
+
return this.#keystate(80 /* ArrowDown */);
|
|
718
597
|
}
|
|
719
598
|
get arrowLeft() {
|
|
720
|
-
return this.#keystate(
|
|
599
|
+
return this.#keystate(81 /* ArrowLeft */);
|
|
721
600
|
}
|
|
722
601
|
get arrowRight() {
|
|
723
|
-
return this.#keystate(
|
|
602
|
+
return this.#keystate(82 /* ArrowRight */);
|
|
724
603
|
}
|
|
725
604
|
get arrowUp() {
|
|
726
|
-
return this.#keystate(
|
|
605
|
+
return this.#keystate(83 /* ArrowUp */);
|
|
727
606
|
}
|
|
728
607
|
get numLock() {
|
|
729
|
-
return this.#keystate(
|
|
608
|
+
return this.#keystate(84 /* NumLock */);
|
|
730
609
|
}
|
|
731
610
|
get numpad0() {
|
|
732
|
-
return this.#keystate(
|
|
611
|
+
return this.#keystate(85 /* Numpad0 */);
|
|
733
612
|
}
|
|
734
613
|
get numpad1() {
|
|
735
|
-
return this.#keystate(
|
|
614
|
+
return this.#keystate(86 /* Numpad1 */);
|
|
736
615
|
}
|
|
737
616
|
get numpad2() {
|
|
738
|
-
return this.#keystate(
|
|
617
|
+
return this.#keystate(87 /* Numpad2 */);
|
|
739
618
|
}
|
|
740
619
|
get numpad3() {
|
|
741
|
-
return this.#keystate(
|
|
620
|
+
return this.#keystate(88 /* Numpad3 */);
|
|
742
621
|
}
|
|
743
622
|
get numpad4() {
|
|
744
|
-
return this.#keystate(
|
|
623
|
+
return this.#keystate(89 /* Numpad4 */);
|
|
745
624
|
}
|
|
746
625
|
get numpad5() {
|
|
747
|
-
return this.#keystate(
|
|
626
|
+
return this.#keystate(90 /* Numpad5 */);
|
|
748
627
|
}
|
|
749
628
|
get numpad6() {
|
|
750
|
-
return this.#keystate(
|
|
629
|
+
return this.#keystate(91 /* Numpad6 */);
|
|
751
630
|
}
|
|
752
631
|
get numpad7() {
|
|
753
|
-
return this.#keystate(
|
|
632
|
+
return this.#keystate(92 /* Numpad7 */);
|
|
754
633
|
}
|
|
755
634
|
get numpad8() {
|
|
756
|
-
return this.#keystate(
|
|
635
|
+
return this.#keystate(93 /* Numpad8 */);
|
|
757
636
|
}
|
|
758
637
|
get numpad9() {
|
|
759
|
-
return this.#keystate(
|
|
638
|
+
return this.#keystate(94 /* Numpad9 */);
|
|
760
639
|
}
|
|
761
640
|
get numpadAdd() {
|
|
762
|
-
return this.#keystate(
|
|
641
|
+
return this.#keystate(95 /* NumpadAdd */);
|
|
763
642
|
}
|
|
764
643
|
get numpadBackspace() {
|
|
765
|
-
return this.#keystate(
|
|
644
|
+
return this.#keystate(96 /* NumpadBackspace */);
|
|
766
645
|
}
|
|
767
646
|
get numpadClear() {
|
|
768
|
-
return this.#keystate(
|
|
647
|
+
return this.#keystate(97 /* NumpadClear */);
|
|
769
648
|
}
|
|
770
649
|
get numpadClearEntry() {
|
|
771
|
-
return this.#keystate(
|
|
650
|
+
return this.#keystate(98 /* NumpadClearEntry */);
|
|
772
651
|
}
|
|
773
652
|
get numpadComma() {
|
|
774
|
-
return this.#keystate(
|
|
653
|
+
return this.#keystate(99 /* NumpadComma */);
|
|
775
654
|
}
|
|
776
655
|
get numpadDecimal() {
|
|
777
|
-
return this.#keystate(
|
|
656
|
+
return this.#keystate(100 /* NumpadDecimal */);
|
|
778
657
|
}
|
|
779
658
|
get numpadDivide() {
|
|
780
|
-
return this.#keystate(
|
|
659
|
+
return this.#keystate(101 /* NumpadDivide */);
|
|
781
660
|
}
|
|
782
661
|
get numpadEnter() {
|
|
783
|
-
return this.#keystate(
|
|
662
|
+
return this.#keystate(102 /* NumpadEnter */);
|
|
784
663
|
}
|
|
785
664
|
get numpadEqual() {
|
|
786
|
-
return this.#keystate(
|
|
665
|
+
return this.#keystate(103 /* NumpadEqual */);
|
|
787
666
|
}
|
|
788
667
|
get numpadHash() {
|
|
789
|
-
return this.#keystate(
|
|
668
|
+
return this.#keystate(104 /* NumpadHash */);
|
|
790
669
|
}
|
|
791
670
|
get numpadMemoryAdd() {
|
|
792
|
-
return this.#keystate(
|
|
671
|
+
return this.#keystate(105 /* NumpadMemoryAdd */);
|
|
793
672
|
}
|
|
794
673
|
get numpadMemoryClear() {
|
|
795
|
-
return this.#keystate(
|
|
674
|
+
return this.#keystate(106 /* NumpadMemoryClear */);
|
|
796
675
|
}
|
|
797
676
|
get numpadMemoryRecall() {
|
|
798
|
-
return this.#keystate(
|
|
677
|
+
return this.#keystate(107 /* NumpadMemoryRecall */);
|
|
799
678
|
}
|
|
800
679
|
get numpadMemoryStore() {
|
|
801
|
-
return this.#keystate(
|
|
680
|
+
return this.#keystate(108 /* NumpadMemoryStore */);
|
|
802
681
|
}
|
|
803
682
|
get numpadMemorySubtract() {
|
|
804
|
-
return this.#keystate(
|
|
683
|
+
return this.#keystate(109 /* NumpadMemorySubtract */);
|
|
805
684
|
}
|
|
806
685
|
get numpadMultiply() {
|
|
807
|
-
return this.#keystate(
|
|
686
|
+
return this.#keystate(110 /* NumpadMultiply */);
|
|
808
687
|
}
|
|
809
688
|
get numpadParenLeft() {
|
|
810
|
-
return this.#keystate(
|
|
689
|
+
return this.#keystate(111 /* NumpadParenLeft */);
|
|
811
690
|
}
|
|
812
691
|
get numpadParenRight() {
|
|
813
|
-
return this.#keystate(
|
|
692
|
+
return this.#keystate(112 /* NumpadParenRight */);
|
|
814
693
|
}
|
|
815
694
|
get numpadStar() {
|
|
816
|
-
return this.#keystate(
|
|
695
|
+
return this.#keystate(113 /* NumpadStar */);
|
|
817
696
|
}
|
|
818
697
|
get numpadSubtract() {
|
|
819
|
-
return this.#keystate(
|
|
698
|
+
return this.#keystate(114 /* NumpadSubtract */);
|
|
820
699
|
}
|
|
821
700
|
get escape() {
|
|
822
|
-
return this.#keystate(
|
|
701
|
+
return this.#keystate(115 /* Escape */);
|
|
823
702
|
}
|
|
824
703
|
get fn() {
|
|
825
|
-
return this.#keystate(
|
|
704
|
+
return this.#keystate(116 /* Fn */);
|
|
826
705
|
}
|
|
827
706
|
get fnLock() {
|
|
828
|
-
return this.#keystate(
|
|
707
|
+
return this.#keystate(117 /* FnLock */);
|
|
829
708
|
}
|
|
830
709
|
get printScreen() {
|
|
831
|
-
return this.#keystate(
|
|
710
|
+
return this.#keystate(118 /* PrintScreen */);
|
|
832
711
|
}
|
|
833
712
|
get scrollLock() {
|
|
834
|
-
return this.#keystate(
|
|
713
|
+
return this.#keystate(119 /* ScrollLock */);
|
|
835
714
|
}
|
|
836
715
|
get pause() {
|
|
837
|
-
return this.#keystate(
|
|
716
|
+
return this.#keystate(120 /* Pause */);
|
|
838
717
|
}
|
|
839
718
|
get browserBack() {
|
|
840
|
-
return this.#keystate(
|
|
719
|
+
return this.#keystate(121 /* BrowserBack */);
|
|
841
720
|
}
|
|
842
721
|
get browserFavorites() {
|
|
843
|
-
return this.#keystate(
|
|
722
|
+
return this.#keystate(122 /* BrowserFavorites */);
|
|
844
723
|
}
|
|
845
724
|
get browserForward() {
|
|
846
|
-
return this.#keystate(
|
|
725
|
+
return this.#keystate(123 /* BrowserForward */);
|
|
847
726
|
}
|
|
848
727
|
get browserHome() {
|
|
849
|
-
return this.#keystate(
|
|
728
|
+
return this.#keystate(124 /* BrowserHome */);
|
|
850
729
|
}
|
|
851
730
|
get browserRefresh() {
|
|
852
|
-
return this.#keystate(
|
|
731
|
+
return this.#keystate(125 /* BrowserRefresh */);
|
|
853
732
|
}
|
|
854
733
|
get browserSearch() {
|
|
855
|
-
return this.#keystate(
|
|
734
|
+
return this.#keystate(126 /* BrowserSearch */);
|
|
856
735
|
}
|
|
857
736
|
get browserStop() {
|
|
858
|
-
return this.#keystate(
|
|
737
|
+
return this.#keystate(127 /* BrowserStop */);
|
|
859
738
|
}
|
|
860
739
|
get eject() {
|
|
861
|
-
return this.#keystate(
|
|
740
|
+
return this.#keystate(128 /* Eject */);
|
|
862
741
|
}
|
|
863
742
|
get launchApp1() {
|
|
864
|
-
return this.#keystate(
|
|
743
|
+
return this.#keystate(129 /* LaunchApp1 */);
|
|
865
744
|
}
|
|
866
745
|
get launchApp2() {
|
|
867
|
-
return this.#keystate(
|
|
746
|
+
return this.#keystate(130 /* LaunchApp2 */);
|
|
868
747
|
}
|
|
869
748
|
get launchMail() {
|
|
870
|
-
return this.#keystate(
|
|
749
|
+
return this.#keystate(131 /* LaunchMail */);
|
|
871
750
|
}
|
|
872
751
|
get mediaPlayPause() {
|
|
873
|
-
return this.#keystate(
|
|
752
|
+
return this.#keystate(132 /* MediaPlayPause */);
|
|
874
753
|
}
|
|
875
754
|
get mediaSelect() {
|
|
876
|
-
return this.#keystate(
|
|
755
|
+
return this.#keystate(133 /* MediaSelect */);
|
|
877
756
|
}
|
|
878
757
|
get mediaStop() {
|
|
879
|
-
return this.#keystate(
|
|
758
|
+
return this.#keystate(134 /* MediaStop */);
|
|
880
759
|
}
|
|
881
760
|
get mediaTrackNext() {
|
|
882
|
-
return this.#keystate(
|
|
761
|
+
return this.#keystate(135 /* MediaTrackNext */);
|
|
883
762
|
}
|
|
884
763
|
get mediaTrackPrevious() {
|
|
885
|
-
return this.#keystate(
|
|
764
|
+
return this.#keystate(136 /* MediaTrackPrevious */);
|
|
886
765
|
}
|
|
887
766
|
get power() {
|
|
888
|
-
return this.#keystate(
|
|
767
|
+
return this.#keystate(137 /* Power */);
|
|
889
768
|
}
|
|
890
769
|
get sleep() {
|
|
891
|
-
return this.#keystate(
|
|
770
|
+
return this.#keystate(138 /* Sleep */);
|
|
892
771
|
}
|
|
893
772
|
get audioVolumeDown() {
|
|
894
|
-
return this.#keystate(
|
|
773
|
+
return this.#keystate(139 /* AudioVolumeDown */);
|
|
895
774
|
}
|
|
896
775
|
get audioVolumeMute() {
|
|
897
|
-
return this.#keystate(
|
|
776
|
+
return this.#keystate(140 /* AudioVolumeMute */);
|
|
898
777
|
}
|
|
899
778
|
get audioVolumeUp() {
|
|
900
|
-
return this.#keystate(
|
|
779
|
+
return this.#keystate(141 /* AudioVolumeUp */);
|
|
901
780
|
}
|
|
902
781
|
get wakeUp() {
|
|
903
|
-
return this.#keystate(
|
|
782
|
+
return this.#keystate(142 /* WakeUp */);
|
|
904
783
|
}
|
|
905
784
|
get hyper() {
|
|
906
|
-
return this.#keystate(
|
|
785
|
+
return this.#keystate(143 /* Hyper */);
|
|
907
786
|
}
|
|
908
787
|
get super() {
|
|
909
|
-
return this.#keystate(
|
|
788
|
+
return this.#keystate(144 /* Super */);
|
|
910
789
|
}
|
|
911
790
|
get turbo() {
|
|
912
|
-
return this.#keystate(
|
|
791
|
+
return this.#keystate(145 /* Turbo */);
|
|
913
792
|
}
|
|
914
793
|
get abort() {
|
|
915
|
-
return this.#keystate(
|
|
794
|
+
return this.#keystate(146 /* Abort */);
|
|
916
795
|
}
|
|
917
796
|
get resume() {
|
|
918
|
-
return this.#keystate(
|
|
797
|
+
return this.#keystate(147 /* Resume */);
|
|
919
798
|
}
|
|
920
799
|
get suspend() {
|
|
921
|
-
return this.#keystate(
|
|
800
|
+
return this.#keystate(148 /* Suspend */);
|
|
922
801
|
}
|
|
923
802
|
get again() {
|
|
924
|
-
return this.#keystate(
|
|
803
|
+
return this.#keystate(149 /* Again */);
|
|
925
804
|
}
|
|
926
805
|
get copy() {
|
|
927
|
-
return this.#keystate(
|
|
806
|
+
return this.#keystate(150 /* Copy */);
|
|
928
807
|
}
|
|
929
808
|
get cut() {
|
|
930
|
-
return this.#keystate(
|
|
809
|
+
return this.#keystate(151 /* Cut */);
|
|
931
810
|
}
|
|
932
811
|
get find() {
|
|
933
|
-
return this.#keystate(
|
|
812
|
+
return this.#keystate(152 /* Find */);
|
|
934
813
|
}
|
|
935
814
|
get open() {
|
|
936
|
-
return this.#keystate(
|
|
815
|
+
return this.#keystate(153 /* Open */);
|
|
937
816
|
}
|
|
938
817
|
get paste() {
|
|
939
|
-
return this.#keystate(
|
|
818
|
+
return this.#keystate(154 /* Paste */);
|
|
940
819
|
}
|
|
941
820
|
get props() {
|
|
942
|
-
return this.#keystate(
|
|
821
|
+
return this.#keystate(155 /* Props */);
|
|
943
822
|
}
|
|
944
823
|
get select() {
|
|
945
|
-
return this.#keystate(
|
|
824
|
+
return this.#keystate(156 /* Select */);
|
|
946
825
|
}
|
|
947
826
|
get undo() {
|
|
948
|
-
return this.#keystate(
|
|
827
|
+
return this.#keystate(157 /* Undo */);
|
|
949
828
|
}
|
|
950
829
|
get hiragana() {
|
|
951
|
-
return this.#keystate(
|
|
830
|
+
return this.#keystate(158 /* Hiragana */);
|
|
952
831
|
}
|
|
953
832
|
get katakana() {
|
|
954
|
-
return this.#keystate(
|
|
833
|
+
return this.#keystate(159 /* Katakana */);
|
|
955
834
|
}
|
|
956
835
|
get f1() {
|
|
957
|
-
return this.#keystate(
|
|
836
|
+
return this.#keystate(160 /* F1 */);
|
|
958
837
|
}
|
|
959
838
|
get f2() {
|
|
960
|
-
return this.#keystate(
|
|
839
|
+
return this.#keystate(161 /* F2 */);
|
|
961
840
|
}
|
|
962
841
|
get f3() {
|
|
963
|
-
return this.#keystate(
|
|
842
|
+
return this.#keystate(162 /* F3 */);
|
|
964
843
|
}
|
|
965
844
|
get f4() {
|
|
966
|
-
return this.#keystate(
|
|
845
|
+
return this.#keystate(163 /* F4 */);
|
|
967
846
|
}
|
|
968
847
|
get f5() {
|
|
969
|
-
return this.#keystate(
|
|
848
|
+
return this.#keystate(164 /* F5 */);
|
|
970
849
|
}
|
|
971
850
|
get f6() {
|
|
972
|
-
return this.#keystate(
|
|
851
|
+
return this.#keystate(165 /* F6 */);
|
|
973
852
|
}
|
|
974
853
|
get f7() {
|
|
975
|
-
return this.#keystate(
|
|
854
|
+
return this.#keystate(166 /* F7 */);
|
|
976
855
|
}
|
|
977
856
|
get f8() {
|
|
978
|
-
return this.#keystate(
|
|
857
|
+
return this.#keystate(167 /* F8 */);
|
|
979
858
|
}
|
|
980
859
|
get f9() {
|
|
981
|
-
return this.#keystate(
|
|
860
|
+
return this.#keystate(168 /* F9 */);
|
|
982
861
|
}
|
|
983
862
|
get f10() {
|
|
984
|
-
return this.#keystate(
|
|
863
|
+
return this.#keystate(169 /* F10 */);
|
|
985
864
|
}
|
|
986
865
|
get f11() {
|
|
987
|
-
return this.#keystate(
|
|
866
|
+
return this.#keystate(170 /* F11 */);
|
|
988
867
|
}
|
|
989
868
|
get f12() {
|
|
990
|
-
return this.#keystate(
|
|
869
|
+
return this.#keystate(171 /* F12 */);
|
|
991
870
|
}
|
|
992
871
|
get f13() {
|
|
993
|
-
return this.#keystate(
|
|
872
|
+
return this.#keystate(172 /* F13 */);
|
|
994
873
|
}
|
|
995
874
|
get f14() {
|
|
996
|
-
return this.#keystate(
|
|
875
|
+
return this.#keystate(173 /* F14 */);
|
|
997
876
|
}
|
|
998
877
|
get f15() {
|
|
999
|
-
return this.#keystate(
|
|
878
|
+
return this.#keystate(174 /* F15 */);
|
|
1000
879
|
}
|
|
1001
880
|
get f16() {
|
|
1002
|
-
return this.#keystate(
|
|
881
|
+
return this.#keystate(175 /* F16 */);
|
|
1003
882
|
}
|
|
1004
883
|
get f17() {
|
|
1005
|
-
return this.#keystate(
|
|
884
|
+
return this.#keystate(176 /* F17 */);
|
|
1006
885
|
}
|
|
1007
886
|
get f18() {
|
|
1008
|
-
return this.#keystate(
|
|
887
|
+
return this.#keystate(177 /* F18 */);
|
|
1009
888
|
}
|
|
1010
889
|
get f19() {
|
|
1011
|
-
return this.#keystate(
|
|
890
|
+
return this.#keystate(178 /* F19 */);
|
|
1012
891
|
}
|
|
1013
892
|
get f20() {
|
|
1014
|
-
return this.#keystate(
|
|
893
|
+
return this.#keystate(179 /* F20 */);
|
|
1015
894
|
}
|
|
1016
895
|
get f21() {
|
|
1017
|
-
return this.#keystate(
|
|
896
|
+
return this.#keystate(180 /* F21 */);
|
|
1018
897
|
}
|
|
1019
898
|
get f22() {
|
|
1020
|
-
return this.#keystate(
|
|
899
|
+
return this.#keystate(181 /* F22 */);
|
|
1021
900
|
}
|
|
1022
901
|
get f23() {
|
|
1023
|
-
return this.#keystate(
|
|
902
|
+
return this.#keystate(182 /* F23 */);
|
|
1024
903
|
}
|
|
1025
904
|
get f24() {
|
|
1026
|
-
return this.#keystate(
|
|
905
|
+
return this.#keystate(183 /* F24 */);
|
|
1027
906
|
}
|
|
1028
907
|
get f25() {
|
|
1029
|
-
return this.#keystate(
|
|
908
|
+
return this.#keystate(184 /* F25 */);
|
|
1030
909
|
}
|
|
1031
910
|
get f26() {
|
|
1032
|
-
return this.#keystate(
|
|
911
|
+
return this.#keystate(185 /* F26 */);
|
|
1033
912
|
}
|
|
1034
913
|
get f27() {
|
|
1035
|
-
return this.#keystate(
|
|
914
|
+
return this.#keystate(186 /* F27 */);
|
|
1036
915
|
}
|
|
1037
916
|
get f28() {
|
|
1038
|
-
return this.#keystate(
|
|
917
|
+
return this.#keystate(187 /* F28 */);
|
|
1039
918
|
}
|
|
1040
919
|
get f29() {
|
|
1041
|
-
return this.#keystate(
|
|
920
|
+
return this.#keystate(188 /* F29 */);
|
|
1042
921
|
}
|
|
1043
922
|
get f30() {
|
|
1044
|
-
return this.#keystate(
|
|
923
|
+
return this.#keystate(189 /* F30 */);
|
|
1045
924
|
}
|
|
1046
925
|
get f31() {
|
|
1047
|
-
return this.#keystate(
|
|
926
|
+
return this.#keystate(190 /* F31 */);
|
|
1048
927
|
}
|
|
1049
928
|
get f32() {
|
|
1050
|
-
return this.#keystate(
|
|
929
|
+
return this.#keystate(191 /* F32 */);
|
|
1051
930
|
}
|
|
1052
931
|
get f33() {
|
|
1053
|
-
return this.#keystate(
|
|
932
|
+
return this.#keystate(192 /* F33 */);
|
|
1054
933
|
}
|
|
1055
934
|
get f34() {
|
|
1056
|
-
return this.#keystate(
|
|
935
|
+
return this.#keystate(193 /* F34 */);
|
|
1057
936
|
}
|
|
1058
937
|
get f35() {
|
|
1059
|
-
return this.#keystate(
|
|
938
|
+
return this.#keystate(194 /* F35 */);
|
|
1060
939
|
}
|
|
1061
940
|
#keystate(code) {
|
|
1062
941
|
let state;
|
|
1063
942
|
if (this.#keystates.has(code)) {
|
|
1064
943
|
state = this.#keystates.get(code);
|
|
1065
944
|
} else {
|
|
1066
|
-
state = {
|
|
1067
|
-
down: false,
|
|
1068
|
-
held: false,
|
|
1069
|
-
up: false
|
|
1070
|
-
};
|
|
945
|
+
state = { down: false, held: false, up: false };
|
|
1071
946
|
this.#keystates.set(code, state);
|
|
1072
947
|
}
|
|
948
|
+
state.held = !!(this.#dataView.getUint8(code) & 1);
|
|
949
|
+
state.down = state.held && !(this.#dataView.getUint8(code) & 2);
|
|
950
|
+
state.up = !state.held && !!(this.#dataView.getUint8(code) & 2);
|
|
1073
951
|
return state;
|
|
1074
952
|
}
|
|
1075
953
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
if (buffer.byteLength !== size) {
|
|
1082
|
-
throw new Error(`Buffer size mismatch: expected ${size}, got ${buffer.byteLength}`);
|
|
1083
|
-
}
|
|
1084
|
-
const dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
1085
|
-
switch (event.type) {
|
|
1086
|
-
case "keydown":
|
|
1087
|
-
case "keyup": {
|
|
1088
|
-
dataView.setUint8(0, keyToKeyCode(event.key));
|
|
1089
|
-
break;
|
|
1090
|
-
}
|
|
1091
|
-
case "mousemove":
|
|
1092
|
-
case "mousewheel": {
|
|
1093
|
-
dataView.setFloat32(0, event.x, true);
|
|
1094
|
-
dataView.setFloat32(Float32Array.BYTES_PER_ELEMENT, event.y, true);
|
|
1095
|
-
break;
|
|
1096
|
-
}
|
|
1097
|
-
case "mousedown":
|
|
1098
|
-
case "mouseup": {
|
|
1099
|
-
dataView.setUint8(0, mouseButtonToMouseButtonCode(event.button));
|
|
1100
|
-
}
|
|
954
|
+
// js/contexts/timeContext.ts
|
|
955
|
+
class TimeContext {
|
|
956
|
+
dataView;
|
|
957
|
+
constructor(dataView) {
|
|
958
|
+
this.dataView = dataView;
|
|
1101
959
|
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
const dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
1106
|
-
const typeByte = dataView.getUint8(0);
|
|
1107
|
-
switch (typeByte) {
|
|
1108
|
-
case 0: {
|
|
1109
|
-
const keyCode = dataView.getUint8(1);
|
|
1110
|
-
return {
|
|
1111
|
-
type: "keydown",
|
|
1112
|
-
key: KeyCode[keyCode]
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
case 1: {
|
|
1116
|
-
const x = dataView.getFloat32(1, true);
|
|
1117
|
-
const y = dataView.getFloat32(Float32Array.BYTES_PER_ELEMENT + 1, true);
|
|
1118
|
-
return {
|
|
1119
|
-
type: "mousemove",
|
|
1120
|
-
x,
|
|
1121
|
-
y
|
|
1122
|
-
};
|
|
960
|
+
get frame() {
|
|
961
|
+
if (!this.dataView) {
|
|
962
|
+
throw new Error("TimeContext DataView is not initialized");
|
|
1123
963
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
};
|
|
964
|
+
return this.dataView.getUint32(0, true);
|
|
965
|
+
}
|
|
966
|
+
get dt() {
|
|
967
|
+
if (!this.dataView) {
|
|
968
|
+
throw new Error("TimeContext DataView is not initialized");
|
|
1130
969
|
}
|
|
1131
|
-
|
|
1132
|
-
throw new Error(`Unknown event type byte: ${typeByte}`);
|
|
970
|
+
return this.dataView.getUint32(4, true) / 1000;
|
|
1133
971
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
switch (event.type) {
|
|
1140
|
-
case "keydown":
|
|
1141
|
-
case "keyheld":
|
|
1142
|
-
case "keyup":
|
|
1143
|
-
case "mousedown":
|
|
1144
|
-
case "mouseup":
|
|
1145
|
-
return Uint8Array.BYTES_PER_ELEMENT * 1;
|
|
1146
|
-
case "mousemove":
|
|
1147
|
-
case "mousewheel":
|
|
1148
|
-
case "mouseheld":
|
|
1149
|
-
return Float32Array.BYTES_PER_ELEMENT * 2;
|
|
972
|
+
get time() {
|
|
973
|
+
if (!this.dataView) {
|
|
974
|
+
throw new Error("TimeContext DataView is not initialized");
|
|
975
|
+
}
|
|
976
|
+
return this.dataView.getUint32(8, true) / 1000;
|
|
1150
977
|
}
|
|
1151
978
|
}
|
|
1152
979
|
|
|
1153
980
|
// js/engine.ts
|
|
1154
981
|
var DEFAULT_WASM_URL = new URL("../wasm/bloop.wasm", import.meta.url);
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
opts.systemsCallback(system_handle, ptr2);
|
|
1162
|
-
},
|
|
1163
|
-
console_log: function(ptr2, len) {},
|
|
1164
|
-
memory
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
const wasm = wasmInstantiatedSource.instance.exports;
|
|
1168
|
-
wasm.initialize();
|
|
1169
|
-
const ptr = wasm.alloc(1);
|
|
1170
|
-
wasm.write_byte(ptr);
|
|
1171
|
-
return {
|
|
1172
|
-
runtime: new Runtime(wasm, memory),
|
|
1173
|
-
wasm
|
|
1174
|
-
};
|
|
1175
|
-
}
|
|
982
|
+
var TIME_CTX_OFFSET = 0;
|
|
983
|
+
var INPUT_CTX_OFFSET = TIME_CTX_OFFSET + 4;
|
|
984
|
+
var EVENTS_OFFSET = INPUT_CTX_OFFSET + 4;
|
|
985
|
+
var SNAPSHOT_HEADER_LEN = 16;
|
|
986
|
+
var SNAPSHOT_HEADER_USER_LEN_OFFSET = 4;
|
|
987
|
+
var SNAPSHOT_HEADER_ENGINE_LEN_OFFSET = 8;
|
|
1176
988
|
export {
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
989
|
+
mouseButtonToMouseButtonCode,
|
|
990
|
+
mouseButtonCodeToMouseButton,
|
|
991
|
+
keyToKeyCode,
|
|
992
|
+
keyCodeToKey,
|
|
993
|
+
TimeContext,
|
|
994
|
+
TIME_CTX_OFFSET,
|
|
995
|
+
SNAPSHOT_HEADER_USER_LEN_OFFSET,
|
|
996
|
+
SNAPSHOT_HEADER_LEN,
|
|
997
|
+
SNAPSHOT_HEADER_ENGINE_LEN_OFFSET,
|
|
998
|
+
MouseContext,
|
|
999
|
+
MOUSE_OFFSET,
|
|
1000
|
+
MOUSE_BUTTONS_OFFSET,
|
|
1001
|
+
KeyboardContext,
|
|
1002
|
+
KEYBOARD_OFFSET,
|
|
1003
|
+
InputContext,
|
|
1004
|
+
INPUT_CTX_OFFSET,
|
|
1005
|
+
exports_enums as Enums,
|
|
1006
|
+
EVENT_PAYLOAD_SIZE,
|
|
1007
|
+
EVENT_PAYLOAD_ALIGN,
|
|
1008
|
+
EVENTS_OFFSET,
|
|
1181
1009
|
DEFAULT_WASM_URL
|
|
1182
1010
|
};
|
|
1183
1011
|
|
|
1184
|
-
//# debugId=
|
|
1012
|
+
//# debugId=A5993CD35B54E56664756E2164756E21
|
|
1185
1013
|
//# sourceMappingURL=engine.js.map
|