diff options
Diffstat (limited to 'src/client/jetc.cpp')
-rw-r--r-- | src/client/jetc.cpp | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/src/client/jetc.cpp b/src/client/jetc.cpp index 2dd6074..8a649b0 100644 --- a/src/client/jetc.cpp +++ b/src/client/jetc.cpp @@ -4,48 +4,11 @@ #include <common/ipc.cpp> #include <common/socket.cpp> #include <client/window.cpp> - -#define NORMAL_MODE 0 -#define INSERT_MODE 1 +#include <client/cursor.cpp> +#include <client/interface.cpp> int main(int argc, char *argv[]) { - Window window; - - int mode = NORMAL_MODE; - - int quit = 0; - while (!quit) { - window.redraw(); - - int input = getch(); - if (mode == NORMAL_MODE) { - switch (input) { - case '': - quit = 1; - break; - case 'i': - mode = INSERT_MODE; - break; - case 'h': - window.move_left(); - break; - case 'l': - window.move_right(); - break; - } - } else { - switch (input) { - case '': - mode = NORMAL_MODE; - break; - case KEY_BACKSPACE: - window.delete_element(); - break; - default: - window.insert_element(input); - } - } - } - + Interface interface; + interface.run(); return 0; } |