diff options
| author | Albert Cervin <albert@acervin.com> | 2022-11-26 00:03:10 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2022-11-27 18:21:08 +0100 |
| commit | 78410b18e5d4d117b714eb9f34c689920c32a985 (patch) | |
| tree | 386f792af7dd8deccdb454182f047b63fc5bc2ce /src/keyboard.h | |
| parent | c40a1cfa0f1ecfddac06c7143c2dd974126ddad3 (diff) | |
| download | dged-78410b18e5d4d117b714eb9f34c689920c32a985.tar.gz dged-78410b18e5d4d117b714eb9f34c689920c32a985.tar.xz dged-78410b18e5d4d117b714eb9f34c689920c32a985.zip | |
Implement the reactor
Currently only supports Linux through epoll.
Diffstat (limited to 'src/keyboard.h')
| -rw-r--r-- | src/keyboard.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/keyboard.h b/src/keyboard.h index 439e60d..1a437fc 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -13,16 +13,23 @@ struct key { uint8_t mod; }; -struct keyboard {}; +struct keyboard { + uint32_t reactor_event_id; + bool has_data; +}; struct keyboard_update { struct key keys[32]; uint32_t nkeys; }; -struct keyboard keyboard_create(); +struct reactor; + +struct keyboard keyboard_create(struct reactor *reactor); + +struct keyboard_update keyboard_begin_frame(struct keyboard *kbd, + struct reactor *reactor); -struct keyboard_update keyboard_begin_frame(struct keyboard *kbd); void keyboard_end_frame(struct keyboard *kbd); bool key_equal(struct key *key, uint8_t mod, uint8_t c); |
