diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-07-09 14:54:23 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-07-09 16:41:45 +0200 |
| commit | 9e7cb40b1f527c1bf431d4ca6c9b9ca4e70b5459 (patch) | |
| tree | 9a6665f3a757d4c91bb3bfac210e16ed2bacf6dc /ui.h | |
| parent | 66f5700d201c9456f917507db77a88115f38961c (diff) | |
| download | vis-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.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 { |
