aboutsummaryrefslogtreecommitdiff
path: root/src/cInput.h
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-06 18:18:32 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-06 18:18:32 +0200
commit99107be8a997eb453b989e1b31123708685696dc (patch)
tree3e822201c2662097ac7c294596e15395de5ab96c /src/cInput.h
parent3fec03eeaa7dbe5152255ebdc0aae9841c241565 (diff)
downloadtermgl-99107be8a997eb453b989e1b31123708685696dc.tar.gz
Changed color handling to take ANSI 8bit colors
added ansi_color_fg(R,G,B) and ..._bg(...) to generate ANSI-colors from RGB values replaced two spaces with tabs in every file to fix terrible tabbing (thanks atom...)
Diffstat (limited to 'src/cInput.h')
-rw-r--r--src/cInput.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/cInput.h b/src/cInput.h
index 00ddb7d..f34095f 100644
--- a/src/cInput.h
+++ b/src/cInput.h
@@ -8,23 +8,23 @@
#ifdef __linux__
#elif _WIN32
- #error "Platforn not supported"
+ #error "Platforn not supported"
#else
- #error "Platforn not supported"
+ #error "Platforn not supported"
#endif
-#define _EVENT_NULL 0
-#define _EVENT_CHAR 1
-#define _EVENT_KEY 2
-#define _EVENT_MOUSE 3
-#define _EVENT_TERM 4
+#define _EVENT_NULL 0
+#define _EVENT_CHAR 1
+#define _EVENT_KEY 2
+#define _EVENT_MOUSE 3
+#define _EVENT_TERM 4
struct sInputEvent
{
- unsigned int type;
- unsigned char c;
- unsigned int b;
- int x, y;
+ unsigned int type;
+ unsigned char c;
+ unsigned int b;
+ int x, y;
};
/**
* ##cInput
@@ -36,23 +36,23 @@ struct sInputEvent
class cInput
{
public:
- cInput();
+ cInput();
- ~cInput();
+ ~cInput();
- /** Reads inputevents
- * returns event struct
- * ### sInputEvent.type
- * * _EVENT_NULL: No input recorded
- * * _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
- */
- sInputEvent poll();
+ /** Reads inputevents
+ * returns event struct
+ * ### sInputEvent.type
+ * * _EVENT_NULL: No input recorded
+ * * _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
+ */
+ sInputEvent poll();
private:
- struct termios original, raw;
+ struct termios original, raw;
};
-#endif /* end of include guard: */
+#endif /* end of include guard: */