aboutsummaryrefslogtreecommitdiff
path: root/src/cInput.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cInput.h')
-rw-r--r--src/cInput.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/cInput.h b/src/cInput.h
index dd9866c..3507959 100644
--- a/src/cInput.h
+++ b/src/cInput.h
@@ -13,12 +13,16 @@
#error "Platforn not supported"
#endif
-#define _EVENT_NULL 0
-#define _EVENT_CHAR 1
+//Macro, to get keycode of Ctrl-(k)
+#define CTRL_KEY(k) ((k) & 0x1f)
+
+#define _EVENT_NULL 0
+#define _EVENT_CHAR 1
#define _EVENT_KEY 2
-#define _EVENT_MOUSE 3
-#define _EVENT_TERM 4
+#define _EVENT_MOUSE 3
+#define _EVENT_TERM 4 //Obsolete
#define _EVENT_FUNCTION1 5
+#define _EVENT_CTRL 6
struct sInputEvent
{
@@ -48,8 +52,9 @@ public:
* * _EVENT_CHAR: A Key was pressed, stored in .c
* * _EVENT_KEY: Escape sequence recorded, stored in .c without escape char
* * _EVENT_MOUSE: Console registered click at (.x, .y) with origin at (0,0) (top left). Mouse button stored in b.
- * * _EVENT_TERM: Console registered Ctrl+C
+ * * _EVENT_TERM: Console registered Ctrl+C. **OBSOLETE** use _EVENT_CTRL
* * _EVENT_FUNCTION1: First few (4?) F-Keys. The rest of the F-Keys is handles by another ESC-Sequence!
+ * * _EVENT_CTRL: Ctrl-key combination was pressed. Use CTRL_KEY( ) Macro to compare
*/
sInputEvent poll();