comparison src/events.nim @ 5:4ed9cb098315

add: structure code for crossplatform, add some input handling + bugfixes
author Sam <sam@basx.dev>
date Thu, 22 Dec 2022 00:06:40 +0700
parents
children
comparison
equal deleted inserted replaced
4:af9183acb173 5:4ed9cb098315
1 type
2 EventType* = enum
3 Quit
4 ResizedWindow
5 KeyDown
6 KeyUp
7 Key* = enum
8 UNKNOWN
9 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
10 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
11 `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `0`
12 Minus, Plus, Underscore, Equals, Space, Enter, Backspace, Tab
13 Comma, Period, Semicolon, Colon,
14 Escape, CtrlL, ShirtL, AltL, CtrlR, ShirtR, AltR
15 Event* = object
16 case eventType*: EventType
17 of KeyDown, KeyUp:
18 key*: Key
19 else:
20 discard