summaryrefslogtreecommitdiff
path: root/input.h
blob: b14dd60d26606a8184eb7953cba8b1a43fd1e6e6 (plain)
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
#ifndef input_h
#define input_h

#include "prbm.h"

struct key {
    i32 last;
    i32 now;
};

struct mouse {
    v2 pos;
    v2 last;
    v2 offset;
    struct key left;
    struct key right;
    i32 first;
    i32 capture;
};

struct input {
    struct mouse mouse;
    struct key right;
    struct key left;
    struct key up;
    struct key down;
    struct key forward;
    struct key backward;
};

struct input init_input(void);
void update_input(struct input *input);
i32 key_down(struct key key);
i32 key_first(struct key key);

#endif