commit 3cb99be19bda77dba849b8c7eca4bae2c05eb6ed
parent 6073d634b75025566075798b94b9b301561e72ad
Author: Claudio Alessi <smoppy@gmail.com>
Date: Sat, 1 Jul 2017 16:49:56 +0200
Ensure CTRL() exists.
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/globox.c b/globox.c
@@ -39,11 +39,19 @@ char *argv0;
/* VT100 escape sequences */
#define CLEAR L"\33[2J"
#define CLEARLN L"\33[2K"
-#define CLEARRIGHT L"\33[K"
+#define CLEARRIGHT L"\33[0K"
#define CURPOS L"\33[%d;%dH"
#define CURSON L"\33[?25h"
#define CURSOFF L"\33[?25l"
+#if defined CTRL && defined _AIX
+ #undef CTRL
+#endif
+#ifndef CTRL
+ #define CTRL(k) ((k) & 0x1F)
+#endif
+#define CTRL_ALT(k) ((k) + (129 - 'a'))
+
/* object flags */
#define OF_OPENUP 1<<1
#define OF_OPENRIGHT 1<<2
@@ -545,6 +553,7 @@ keypress(void) {
for(i = 0; i < LENGTH(keys); ++i)
if(keys[i].key == key)
keys[i].func(&keys[i].arg);
+ /* XXX getkey()? */
while(getchar() != EOF); /* discard remaining input */
}