How to detect that an arrow key is pressed using C under Linux or Solaris?

What is the best way to detect in a C program by holding down the arrow key in Linux or Solaris?

As I know, there is no standard C function that can do this. I do not want to use the int86 function. I need to make this a portable way.

Change . I ask about console applications.

+5
source share
3 answers

You should look at the curses / ncurses library, which will provide you with advanced screen and keyboard settings for console applications.

, , .

+5

, ,

+2

If you want to do this without using something like SDL, you should learn the select () statement and how to use it to read from console input.

0
source

All Articles