summaryrefslogtreecommitdiffstats
path: root/src/c_init.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/c_init.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/c_init.c b/src/c_init.c
index effcc7d..18482c1 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -9,6 +9,9 @@
/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */
/* */
/* ************************************************************************** */
+# define FT_KEY_LEFT (char[4]){ 27, 91, 68, 0 }
+# define FT_KEY_RIGHT (char[4]){ 27, 91, 67, 0 }
+
#include <unistd.h>
#include <termios.h>
@@ -110,9 +113,11 @@ int16_t
}
else
{
- if (strncmp(buf, tgetstr("kr", NULL), ft_strlen(tgetstr("kr", NULL))) == 0)
+ /* if (strncmp(buf, tgetstr("kr", NULL), ft_strlen(tgetstr("kr", NULL))) == 0) */
+ /* if ((*((unsigned int*)buf)) == FT_KEY_RIGHT) */
+ if (strncmp(buf, FT_KEY_LEFT, 4) == 0)
{
- return (c_key_right(ft_strlen(line), tcaps));
+ return (c_key_left(ft_strlen(line), tcaps));
}
else if (buf[0] == '\n')
{