annotate semiconginev2/events.nim @ 1253:c4f98eb4bb05

fix: a few things
author sam <sam@basx.dev>
date Fri, 26 Jul 2024 23:39:24 +0700
parents 56781cc0fc7c
children bfb75c934f4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1191
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
1 type
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
2 EventType* = enum
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
3 Quit
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
4 ResizedWindow, MinimizedWindow, RestoredWindow
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
5 KeyPressed, KeyReleased
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
6 MousePressed, MouseReleased, MouseMoved,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
7 MouseWheel
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
8 Key* {.size: sizeof(cint), pure.} = enum
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
9 UNKNOWN
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
10 Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
11 NumberRowExtra1, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `0`,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
12 NumberRowExtra2, NumberRowExtra3 # tilde, minus, plus
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
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
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
14 Tab, CapsLock, ShiftL, ShiftR, CtrlL, CtrlR, SuperL, SuperR, AltL, AltR,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
15 Space, Enter, Backspace
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
16 LetterRow1Extra1, LetterRow1Extra2 # open bracket, close brackt, backslash
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
17 LetterRow2Extra1, LetterRow2Extra2, LetterRow2Extra3 # semicolon, quote
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
18 LetterRow3Extra1, LetterRow3Extra2, LetterRow3Extra3 # comma, period, slash
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
19 Up, Down, Left, Right
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
20 PageUp, PageDown, Home, End, Insert, Delete
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
21 PrintScreen, ScrollLock, Pause
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
22 MouseButton* {.size: sizeof(cint), pure.} = enum
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
23 UNKNOWN, Mouse1, Mouse2, Mouse3
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
24 Event* = object
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
25 case eventType*: EventType
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
26 of KeyPressed, KeyReleased:
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
27 key*: Key
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
28 of MousePressed, MouseReleased:
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
29 button*: MouseButton
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
30 of MouseMoved:
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
31 x*, y*: int
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
32 of MouseWheel:
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
33 amount*: float32
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
34 else:
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
35 discard