diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-08-28 16:12:40 +0200 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-08-28 16:12:40 +0200 |
commit | d500766251ca351bb11c67762ffeccf3184bd808 (patch) | |
tree | 1435bdad97ac03b7285e659eccfe8b16eabd7578 /src/c_init.c | |
parent | pourquoi seul nd foncitonne ????????????????????????? (diff) | |
download | 42-minishell-d500766251ca351bb11c67762ffeccf3184bd808.tar.gz 42-minishell-d500766251ca351bb11c67762ffeccf3184bd808.tar.bz2 42-minishell-d500766251ca351bb11c67762ffeccf3184bd808.tar.xz 42-minishell-d500766251ca351bb11c67762ffeccf3184bd808.tar.zst 42-minishell-d500766251ca351bb11c67762ffeccf3184bd808.zip |
HJKL LETS GOOOO
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); |