aboutsummaryrefslogtreecommitdiff
path: root/sdk-modifications/libsrc/key/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'sdk-modifications/libsrc/key/key.h')
-rwxr-xr-xsdk-modifications/libsrc/key/key.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/sdk-modifications/libsrc/key/key.h b/sdk-modifications/libsrc/key/key.h
new file mode 100755
index 0000000..21674ec
--- /dev/null
+++ b/sdk-modifications/libsrc/key/key.h
@@ -0,0 +1,31 @@
+#ifndef __KEY_H__
+#define __KEY_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define KEY_PRESS(key, key_id) (!(key & (key_id<<16)) && (key & key_id))
+#define KEY_HOLD(key, key_id) ((key & (key_id<<16)) && (key & key_id))
+#define KEY_RELEASE(key, key_id) ((key & (key_id<<16)) && !(key & key_id))
+
+/*
+* Function: only detect the key pressed or not
+*/
+unsigned int getKey(void);
+
+/*
+* Function: can get the detail information about key pressed, hold, or release
+*/
+unsigned int getKey1(void);
+
+/*
+* Function: detect the key pressed or not and touched position
+*/
+extern unsigned int getInput(struct key_buf *input);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__KEY_H__