From f9671485f8049fbc6909cc757eae851ac1b5e3b9 Mon Sep 17 00:00:00 2001 From: salad Date: Fri, 11 Sep 2020 14:29:48 +0200 Subject: home works, not END. lets go for a bit of norming --- src/c_input.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/c_input.c') diff --git a/src/c_input.c b/src/c_input.c index f92a784..2435e4a 100644 --- a/src/c_input.c +++ b/src/c_input.c @@ -59,10 +59,42 @@ int16_t t_msh *msh) { tputs(tgetstr("cl", NULL), 1, ft_putchar); + m_prompt_psx(1, msh); c_redraw_line(line, tcaps->cpos, msh); return (1); } +int16_t + c_home_key(t_caps *tcaps) +{ + uint16_t i; + + i = tcaps->cpos; + while (i > 0) + { + tputs(tgetstr("le", NULL), 1, ft_putchar); + i--; + } + tcaps->cpos = 0; + return (1); +} + +int16_t + c_end_key(uint16_t size, t_caps *tcaps) +{ + uint16_t i; + + i = tcaps->cpos; + while (i < size) + { + tputs(tgetstr("nd", NULL), 1, ft_putchar); + i++; + } + tcaps->cpos = size; + return (1); +} + + int16_t c_key_right(uint32_t len, t_caps *tcaps) -- cgit v1.2.3