summaryrefslogtreecommitdiff
path: root/src/keyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.h')
-rw-r--r--src/keyboard.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/keyboard.h b/src/keyboard.h
index 4078213..18630c3 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -7,16 +7,16 @@ enum modifiers {
Meta = 1 << 1,
};
-// note that unicode chars are split over multiple keypresses
-// TODO: make unicode chars nicer to deal with
struct key {
- uint8_t c;
+ uint8_t bytes[6];
+ uint8_t nbytes;
uint8_t mod;
};
struct keyboard {
uint32_t reactor_event_id;
bool has_data;
+ struct key last_key;
};
struct keyboard_update {
@@ -31,5 +31,6 @@ struct keyboard keyboard_create(struct reactor *reactor);
struct keyboard_update keyboard_update(struct keyboard *kbd,
struct reactor *reactor);
-bool key_equal(struct key *key, uint8_t mod, uint8_t c);
+bool key_equal_char(struct key *key, uint8_t mod, uint8_t c);
+bool key_equal(struct key *key1, struct key *key2);
void key_name(struct key *key, char *buf, size_t capacity);