Archived
1
Fork 0
This repository has been archived on 2024-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
kilo/src/input.c

28 lines
506 B
C
Raw Normal View History

2023-09-01 15:04:12 +00:00
#include <stdlib.h>
#include "input.h"
#include "terminal.h"
#include "commands.h"
void input_process_key(void) {
KEY c = terminal_read_key();
switch (c) {
case ARROW_LEFT:
case ARROW_DOWN:
case ARROW_UP:
case ARROW_RIGHT:
case HOME:
case END:
case PG_UP:
case PG_DOWN:
editor_move_cursor(c);
break;
case CTRL_KEY('Q'):
terminal_clear();
exit(0);
break;
}
}