diff options
Diffstat (limited to 'src/c_init.c')
-rw-r--r-- | src/c_init.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/c_init.c b/src/c_init.c index 0c77224..f472f47 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -50,14 +50,21 @@ void c_process_key(t_caps *tcaps) { exit(0); else if (strncmp(nread, "l", 1) == 0) { - tputs(tgoto(tcaps->nd, 1, 1), 1, putchar); - /* write(1, tcaps->nd, strlen(tcaps->nd)); */ + /* tputs(tgoto(tcaps->nd, 1, 1), 1, putchar); */ + write(1, tcaps->nd, strlen(tcaps->nd)); } - else if (strncmp(nread, tcaps->cl, strlen(tcaps->cl)) == 0) + else if (strncmp(nread, "c", 1) == 0) write(1, tcaps->cl, strlen(tcaps->cl)); + else if (strncmp(nread, "j", 1) == 0) + write(1, tcaps->DO, strlen(tcaps->DO)); else if (strncmp(nread, "k", 1) == 0) { - write(1, tcaps->bc, strlen(tcaps->nd)); + write(1, tcaps->up, strlen(tcaps->kl)); + /* tputs(tgoto(tcaps->bc, 1, 1), 1, putchar); */ + } + else if (strncmp(nread, "h", 1) == 0) + { + write(1, tcaps->le, strlen(tcaps->le)); /* tputs(tgoto(tcaps->bc, 1, 1), 1, putchar); */ } else @@ -82,6 +89,8 @@ int16_t c_init_tcaps(void) tcaps.bc = tgetstr("bc", &term); tcaps.up = tgetstr("up", &term); tcaps.nd = tgetstr("nd", &term); + tcaps.le = tgetstr("le", &term); + tcaps.DO = tgetstr("do", &term); tcgetattr(STDIN_FILENO, &tcaps.tios); tcaps.tios.c_lflag &= ~(ECHO | ICANON); |