diff options
author | cflip <cflip@cflip.net> | 2023-01-09 15:47:26 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-09 15:47:26 -0700 |
commit | c1573dbbb3e70cad8c1f94cbed5b2abf2b124ace (patch) | |
tree | 8333d29b92f12f7cbf97deb38e25875887d6b19a /input.c | |
parent | 54d8fdd290e21ae8c773b4228827ee7539637ce8 (diff) |
Implement basic keyboard event handling
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -97,10 +97,9 @@ void editor_move_cursor(struct editor_state* editor, int key) editor->cursor_x = row_length; } -void editor_process_keypress(struct editor_state* editor) +void editor_process_keypress(struct editor_state* editor, int c) { static int quit_message = 1; - int c = editor_read_key(); switch (c) { case '\r': @@ -112,8 +111,6 @@ void editor_process_keypress(struct editor_state* editor) quit_message = 0; return; } - write(STDOUT_FILENO, "\x1b[2J", 4); - write(STDOUT_FILENO, "\x1b[H", 3); exit(0); break; case CTRL_KEY('s'): |