cat_engine_basement 0.0.0-alpha7

The CatEnigne's basement
Documentation
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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
use super::{
    Ticks,
};

pub enum Event{
    Process(ProcessEvent),
    Window(WindowEvent),
}

#[derive(Debug)]
pub enum ProcessEvent{
    EventLoopStart,

    Update(Ticks),
    /// The current thread has made a request to close.
    Quit,

    EventLoopBreak,
}

#[derive(Debug)]
pub enum WindowEvent{
    MouseMove([u16;2]),
    MousePress{
        cursor_position:[u16;2],
        button:MouseButton,
    },
    MouseRelease{
        cursor_position:[u16;2],
        button:MouseButton,
    },

    MouseScroll(i16),

    KeyPress(VirtualKeyCode),
    KeyRelease(VirtualKeyCode),
    CharacterInput(char),
}

/// Describes mouse buttons.
/// 
/// Описывает кнопки мыши.
#[derive(Debug,Clone,Copy)]
pub enum MouseButton{
    Left,
    Middle,
    Right,
    Button4,
    Button5,
}

#[derive(Debug,Clone,Copy)]
pub enum VirtualKeyCode{
    Null,
    /// Left mouse button
    LBUTTON,
    /// Right mouse button
    RBUTTON,
    /// Control-break processing
    CANCEL,
    /// Middle mouse button (three-button mouse)
    MBUTTON,
    /// X1 mouse button
    XBUTTON1,
    /// X2 mouse button
    XBUTTON2,
    Undefined0x07,
    /// BACKSPACE key
    BACK,
    /// TAB key
    TAB,
    Reserved0x0A,
    Reserved0x0B,
    /// CLEAR key
    CLEAR,
    /// ENTER key
    RETURN,
    Undefined0x0E,
    Undefined0x0F,
    /// SHIFT key
    SHIFT,
    /// CTRL key
    CONTROL,
    /// ALT key
    MENU,
    /// PAUSE key
    PAUSE,
    /// CAPS LOCK key,
    CAPITAL,
    /// HANGUEL, HANGUL - IME Kana mode, IME Hanguel mode, IME Hangul mode
    KANA,
    /// IME On
    IME_ON,
    /// IME Junja mode
    JUNJA,
    /// IME final mode
    FINAL,
    /// KANJI -  IME Hanja mode, IME Kanji mode
    HANJA,
    /// IME Off
    IME_OFF,
    /// ESC key
    ESCAPE,
    /// IME convert
    CONVERT,
    /// IME nonconvert
    NONCONVERT,
    /// IME accept
    ACCEPT,
    /// IME mode change request
    MODECHANGE,
    /// SPACEBAR
    SPACE,
    /// PAGE UP key
    PRIOR,
    /// PAGE DOWN key
    NEXT,
    /// END key
    END,
    /// HOME key
    HOME,
    /// LEFT ARROW key
    LEFT,
    /// UP ARROW key
    UP,
    /// RIGHT ARROW key
    RIGHT,
    /// DOWN ARROW key
    DOWN,
    /// SELECT key
    SELECT,
    /// PRINT key
    PRINT,
    /// EXECUTE key
    EXECUTE,
    /// PRINT SCREEN key
    SNAPSHOT,
    /// INS key
    INSERT,
    /// DEL key
    DELETE,
    /// HELP key
    HELP,
    /// 0 key
    Zero,
    /// 1 key
    One,
    /// 2 key
    Two,
    /// 3 key
    Three,
    /// 4 key
    Four,
    /// 5 key
    Five,
    /// 6 key
    Six,
    /// 7 key
    Seven,
    /// 8 key
    Eight,
    /// 9 key
    Nine,
    Undefined0x3A,
    Undefined0x3B,
    Undefined0x3C,
    Undefined0x3D,
    Undefined0x3E,
    Undefined0x3F,
    Undefined0x40,
    /// A key
    A,
    /// B key
    B,
    /// C key
    C,
    /// D key
    D,
    /// E key
    E,
    /// F key
    F,
    /// G key
    G,
    /// H key
    H,
    /// I key
    I,
    /// J key
    J,
    /// K key
    K,
    /// L key
    L,
    /// M key
    M,
    /// N key
    N,
    /// O key
    O,
    /// P key
    P,
    /// Q key
    Q,
    /// R key
    R,
    /// S key
    S,
    /// T key
    T,
    /// U key
    U,
    /// V key
    V,
    /// W key
    W,
    /// X key
    X,
    /// Y key
    Y,
    /// Z key
    Z,
    /// Left Windows key (Natural keyboard)
    LWIN,
    /// Right Windows key (Natural keyboard)
    RWIN,
    /// Applications key (Natural keyboard)
    APPS, 
    Reserved0x5E,
    /// Computer Sleep key
    SLEEP,
    /// Numeric keypad 0 key
    NUMPAD0,
    /// Numeric keypad 1 key
    NUMPAD1,
    /// Numeric keypad 2 key
    NUMPAD2,
    /// Numeric keypad 3 key
    NUMPAD3,
    /// Numeric keypad 4 key
    NUMPAD4,
    /// Numeric keypad 5 key
    NUMPAD5,
    /// Numeric keypad 6 key
    NUMPAD6,
    /// Numeric keypad 7 key
    NUMPAD7,
    /// Numeric keypad 8 key
    NUMPAD8,
    /// Numeric keypad 9 key
    NUMPAD9,
    /// Multiply key
    MULTIPLY,
    /// Add key
    ADD,
    /// Separator key
    SEPARATOR,
    /// Subtract key
    SUBTRACT,
    /// Decimal key
    DECIMAL,
    /// Divide key
    DIVIDE,
    /// F1 key
    F1,
    /// F2 key
    F2,
    /// /// F3 key
    F3,
    /// F4 key
    F4,
    /// F5 key
    F5,
    /// F6 key
    F6,
    /// F7 key
    F7,
    /// F8 key
    F8,
    /// F9 key
    F9,
    /// F10 key
    F10,
    /// F11 key
    F11,
    /// F12 key
    F12,
    /// F13 key
    F13,
    /// F14 key
    F14,
    /// F15 key
    F15,
    /// F16 key
    F16,
    /// F17 key
    F17,
    /// F18 key
    F18,
    /// F19 key
    F19,
    /// F20 key
    F20,
    /// F21 key
    F21,
    /// F22 key
    F22,
    /// F23 key
    F23,
    /// F24 key
    F24,
    Unassigned0x88,
    Unassigned0x89,
    Unassigned0x8A,
    Unassigned0x8B,
    Unassigned0x8C,
    Unassigned0x8D,
    Unassigned0x8E,
    Unassigned0x8F,
    /// NUM LOCK key
    NUMLOCK,
    /// SCROLL LOCK key
    SCROLL,
    OEM_Specific0x92,
    OEM_Specific0x93,
    OEM_Specific0x94,
    OEM_Specific0x95,
    OEM_Specific0x96,
    Unassigned0x97,
    Unassigned0x98,
    Unassigned0x99,
    Unassigned0x9A,
    Unassigned0x9B,
    Unassigned0x9C,
    Unassigned0x9D,
    Unassigned0x9E,
    Unassigned0x9F,
    /// Left SHIFT key
    LSHIFT,
    /// Right SHIFT key
    RSHIFT,
    /// Left CONTROL key
    LCONTROL,
    /// Right CONTROL key
    RCONTROL,
    /// Left MENU key
    LMENU,
    /// Right MENU key
    RMENU,
    /// Browser Back key
    BROWSER_BACK,
    /// Browser Forward key
    BROWSER_FORWARD,
    /// Browser Refresh key
    BROWSER_REFRESH,
    /// Browser Stop key
    BROWSER_STOP,
    /// Browser Search key
    BROWSER_SEARCH,
    /// Browser Favorites key
    BROWSER_FAVORITES,
    /// Browser Start and Home key
    BROWSER_HOME,
    /// Volume Mute key
    VOLUME_MUTE,
    /// Volume Down key
    VOLUME_DOWN,
    /// Volume Up key
    VOLUME_UP,
    /// Next Track key
    MEDIA_NEXT_TRACK,
    /// Previous Track key
    MEDIA_PREV_TRACK,
    /// Stop Media key
    MEDIA_STOP,
    /// Play/Pause Media key
    MEDIA_PLAY_PAUSE,
    /// Start Mail key
    LAUNCH_MAIL,
    /// Select Media key
    LAUNCH_MEDIA_SELECT,
    /// Start Application 1 key
    LAUNCH_APP1,
    /// Start Application 2 key
    LAUNCH_APP2,
    ReservedB8,
    ReservedB9,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ';:' key
    OEM_1,
    /// For any country/region, the '+' key
    OEM_PLUS,
    /// For any country/region, the ',' key
    OEM_COMMA,
    /// For any country/region, the '-' key
    OEM_MINUS,
    /// For any country/region, the '.' key
    OEM_PERIOD,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '/?' key
    OEM_2,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '`~' key
    OEM_3,
    Reserved0xC1,
    Reserved0xC2,
    Reserved0xC3,
    Reserved0xC4,
    Reserved0xC5,
    Reserved0xC6,
    Reserved0xC7,
    Reserved0xC8,
    Reserved0xC9,
    Reserved0xCA,
    Reserved0xCB,
    Reserved0xCC,
    Reserved0xCD,
    Reserved0xCE,
    Reserved0xCF,
    Reserved0xD0,
    Reserved0xD1,
    Reserved0xD2,
    Reserved0xD3,
    Reserved0xD4,
    Reserved0xD5,
    Reserved0xD6,
    Reserved0xD7,
    Unassigned0xD8,
    Unassigned0xD9,
    Unassigned0xDA,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '[{' key
    OEM_4,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '\|' key
    OEM_5,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ']}' key
    OEM_6,
    /// Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the 'single-quote/double-quote' key
    OEM_7,
    /// Used for miscellaneous characters; it can vary by keyboard.
    OEM_8,
    Reserved0xE0,
    OEM_Specific0xE1,
    /// Either the angle bracket key or the backslash key on the RT 102-key keyboard
    OEM_102,
    OEM_Specific0xE3,
    OEM_Specific0xE4,
    /// IME PROCESS key
    PROCESSKEY,
    OEM_Specific0xE6,
    /// Used to pass Unicode characters as if they were keystrokes. The PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
    PACKET,
    Unassigned0xE8,
    OEM_Specific0xE9,
    OEM_Specific0xEA,
    OEM_Specific0xEB,
    OEM_Specific0xEC,
    OEM_Specific0xED,
    OEM_Specific0xEE,
    OEM_Specific0xEF,
    OEM_Specific0xF0,
    OEM_Specific0xF1,
    OEM_Specific0xF2,
    OEM_Specific0xF3,
    OEM_Specific0xF4,
    OEM_Specific0xF5,
    /// Attn key
    ATTN,
    /// CrSel key
    CRSEL,
    EXSEL,// ExSel key
    /// Erase EOF key
    EREOF,
    /// Play key
    PLAY,
    /// Zoom key
    ZOOM,
    /// Reserved
    NONAME,
    /// PA1 key
    PA1,
    /// Clear key
    OEM_CLEAR,
}