Hello.
I'm writing a small game for fun and I'm having a problem with the function keys, specifically F1-F4.
Code:
#include <curses.h>
void input()
{
int choice;
choice = getch();
printw("%c\n", choice);
refresh();
}
When I press any other function key, the character returns as "^Q" or "^R", but for some reason those 4 keys (F1-F4) return things like "^[[11~". Even when I do something like:
Code:
if(choice == KEY_F(1)) // or F2,F3,F3
{
...
}
it doesn't work. But, If I use any of the other function keys, it works. Is this a hardware problem on my side, or am I just doing something wrong? It's not just for ncurses either, it happens regardless.
I'm on linux, if that's of any help.