aboutsummaryrefslogtreecommitdiff
path: root/include/key_state.h
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-19 18:59:27 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-19 18:59:27 -0700
commit470b4dfbae146d83c0061b39534c16b5aad90f1c (patch)
tree89560b95f1501ecd24036ca69f524771230fe2f0 /include/key_state.h
parent4db89b5fe46e8e7dc741b0ccb9fa3d0708c6fa59 (diff)
key_state.ch, and command conflicts resolved
Diffstat (limited to 'include/key_state.h')
-rw-r--r--include/key_state.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/key_state.h b/include/key_state.h
new file mode 100644
index 00000000..a8fa8d5e
--- /dev/null
+++ b/include/key_state.h
@@ -0,0 +1,18 @@
+#ifndef _SWAY_KEY_STATE_H
+#define _SWAY_KEY_STATE_H
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef uint32_t keycode;
+
+// returns true if key has been pressed, otherwise false
+bool check_key(keycode key);
+
+// sets a key as pressed
+void press_key(keycode key);
+
+// unsets a key as pressed
+void release_key(keycode key);
+
+#endif
+