diff --git a/games/snake/snake_input_console.h b/games/snake/snake_input_console.h index 9f6f2bbea..03254f5d5 100644 --- a/games/snake/snake_input_console.h +++ b/games/snake/snake_input_console.h @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include "snake_inputs.h" @@ -188,24 +189,24 @@ int dev_read_input(FAR struct input_state_s *dev) /* Arrows keys return three bytes: 27 91 [65-68] */ - if ((ch = getch()) == 27) + if ((ch = getch()) == ASCII_ESC) { - if ((ch = getch()) == 91) + if ((ch = getch()) == ASCII_LBRACKET) { ch = getch(); - if (ch == 65) + if (ch == ASCII_A) { dev->dir = DIR_UP; } - else if (ch == 66) + else if (ch == ASCII_B) { dev->dir = DIR_DOWN; } - else if (ch == 67) + else if (ch == ASCII_C) { dev->dir = DIR_RIGHT; } - else if (ch == 68) + else if (ch == ASCII_D) { dev->dir = DIR_LEFT; }