Search code examples
cinputkeyncursescurses

How do I detect arrow keys pressed using curses in C?


In trying to get input from the arrow keys via curses (ncurses) it won't catch as KEY_UP etc. I used the keypad function with a true argument but getch still returned an escaped sequence. How do I shift through the values returned by getch() and grab the arrow keys specifically?


Solution

  • I was storing getch() calls as char's when they were supposed to be int's. Works perfectly after the switch.