1191
|
1 type
|
|
2 EventType* = enum
|
|
3 Quit
|
|
4 ResizedWindow, MinimizedWindow, RestoredWindow
|
|
5 KeyPressed, KeyReleased
|
|
6 MousePressed, MouseReleased, MouseMoved,
|
|
7 MouseWheel
|
|
8 Key* {.size: sizeof(cint), pure.} = enum
|
|
9 UNKNOWN
|
|
10 Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12
|
|
11 NumberRowExtra1, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `0`,
|
|
12 NumberRowExtra2, NumberRowExtra3 # tilde, minus, plus
|
|
13 A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
|
|
14 Tab, CapsLock, ShiftL, ShiftR, CtrlL, CtrlR, SuperL, SuperR, AltL, AltR,
|
|
15 Space, Enter, Backspace
|
|
16 LetterRow1Extra1, LetterRow1Extra2 # open bracket, close brackt, backslash
|
|
17 LetterRow2Extra1, LetterRow2Extra2, LetterRow2Extra3 # semicolon, quote
|
|
18 LetterRow3Extra1, LetterRow3Extra2, LetterRow3Extra3 # comma, period, slash
|
|
19 Up, Down, Left, Right
|
|
20 PageUp, PageDown, Home, End, Insert, Delete
|
|
21 PrintScreen, ScrollLock, Pause
|
|
22 MouseButton* {.size: sizeof(cint), pure.} = enum
|
|
23 UNKNOWN, Mouse1, Mouse2, Mouse3
|
|
24 Event* = object
|
|
25 case eventType*: EventType
|
|
26 of KeyPressed, KeyReleased:
|
|
27 key*: Key
|
|
28 of MousePressed, MouseReleased:
|
|
29 button*: MouseButton
|
|
30 of MouseMoved:
|
|
31 x*, y*: int
|
|
32 of MouseWheel:
|
|
33 amount*: float32
|
|
34 else:
|
|
35 discard
|