diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | src/c_init.c | 3 | ||||
-rw-r--r-- | src/c_keys.c | 1 | ||||
-rw-r--r-- | src/c_keys_next.c | 25 | ||||
-rw-r--r-- | src/c_keys_next.h | 20 |
5 files changed, 49 insertions, 1 deletions
@@ -38,6 +38,7 @@ SRCS_NAME += c_ctrls SRCS_NAME += c_init SRCS_NAME += c_input SRCS_NAME += c_keys +SRCS_NAME += c_keys_next SRCS_NAME += c_utils SRCS_NAME += e_builtins SRCS_NAME += e_externs diff --git a/src/c_init.c b/src/c_init.c index 5e09031..84f91db 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -20,6 +20,7 @@ #include "c_ctrls.h" #include "c_init.h" #include "c_keys.h" +#include "c_keys_next.h" #include "c_input.h" #include "c_utils.h" #include "b_exit.h" @@ -90,7 +91,7 @@ static short return (c_ctrl_l(line, tcaps, msh)); else if (((*((unsigned int *)buf)) == UP_K) || ((*((unsigned int *)buf)) == CTRL_P)) - return (ft_dprintf(0, "qweqwe\n")); + return (c_key_up(tcaps)); else if ((*((unsigned int *)buf)) == CTRL_D && line[0] == '\0') { diff --git a/src/c_keys.c b/src/c_keys.c index 3d80327..6391631 100644 --- a/src/c_keys.c +++ b/src/c_keys.c @@ -70,6 +70,7 @@ short while (i++ < size) tputs(tgetstr("nd", NULL), 1, ft_putchar); tcaps->cpos = size; + ft_printf("%d\n", tcaps->cpos); tcaps->lpos = tcaps->nlines; return (1); } diff --git a/src/c_keys_next.c b/src/c_keys_next.c new file mode 100644 index 0000000..68b2a3a --- /dev/null +++ b/src/c_keys_next.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* c_keys_next.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <term.h> + +#include "c_init.h" + +short c_key_up(t_caps *tcaps) +{ + tputs("qwe", 1, ft_putchar); + tcaps->cpos = 3; + tcaps->lpos = 1; + /* ft_dprintf(0, "qwe"); */ + return (1); +} diff --git a/src/c_keys_next.h b/src/c_keys_next.h new file mode 100644 index 0000000..f71ff5c --- /dev/null +++ b/src/c_keys_next.h @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* c_keys_next.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef C_KEYS_NEXT_H +# define C_KEYS_NEXT_H + +#include "c_init.h" + +short c_key_up(t_caps *tcaps); + +#endif |