aboutsummaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-09 14:54:23 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-09 16:41:45 +0200
commit9e7cb40b1f527c1bf431d4ca6c9b9ca4e70b5459 (patch)
tree9a6665f3a757d4c91bb3bfac210e16ed2bacf6dc /ui.h
parent66f5700d201c9456f917507db77a88115f38961c (diff)
downloadvis-9e7cb40b1f527c1bf431d4ca6c9b9ca4e70b5459.tar.gz
vis-9e7cb40b1f527c1bf431d4ca6c9b9ca4e70b5459.tar.xz
ui: move input handling code to ui specific files
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui.h b/ui.h
index 732c618..40e2ea7 100644
--- a/ui.h
+++ b/ui.h
@@ -15,6 +15,11 @@ enum UiOption {
UI_OPTION_LINE_NUMBERS_RELATIVE = 1 << 1,
};
+typedef struct {
+ char str[6]; /* UTF8 character or terminal escape code */
+ int code; /* curses KEY_* constant */
+} Key;
+
#include <stdbool.h>
#include <stdarg.h>
#include "text.h"
@@ -40,10 +45,8 @@ struct Ui {
void (*update)(Ui*);
void (*suspend)(Ui*);
void (*resume)(Ui*);
-/* TODO main loop integration, signal handling
- Key getkey(void);
- bool haskey(void);
-*/
+ Key (*getkey)(Ui*);
+ bool (*haskey)(Ui*);
};
struct UiWin {