diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-09-13 17:49:38 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-10-05 15:54:30 +0200 |
| commit | a76057df97157dc76959bcd40649f5953aebc9d3 (patch) | |
| tree | 75df46b238edacc60ede00ee5821d47cb814b316 /ui.h | |
| parent | fa950307aeb2a060be72fc73e0017e5497cb4ace (diff) | |
| download | vis-a76057df97157dc76959bcd40649f5953aebc9d3.tar.gz vis-a76057df97157dc76959bcd40649f5953aebc9d3.tar.xz | |
vis: rework input handling using libtermkey
Key bindings are now specified as symbolic key strings, this
will eventually allow run time configurable key mappings.
This introduces a bulid time dependency on libtermkey which
can be found at:
http://www.leonerd.org.uk/code/libtermkey/
Diffstat (limited to 'ui.h')
| -rw-r--r-- | ui.h | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -15,13 +15,9 @@ 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 <termkey.h> #include "text.h" #include "view.h" #include "editor.h" @@ -44,10 +40,11 @@ struct Ui { void (*update)(Ui*); void (*suspend)(Ui*); void (*resume)(Ui*); - Key (*getkey)(Ui*); + const char* (*getkey)(Ui*); bool (*haskey)(Ui*); void (*terminal_save)(Ui*); void (*terminal_restore)(Ui*); + TermKey* (*termkey_get)(Ui*); }; struct UiWin { |
