Hi,
I want to know how to read the arrow keys in Linux. I'm making a test with a program similar to less and I want to use up & down keys for moving through the file, but there's no ASCII code for these keys.
Thanks in advance.
Hi,
I want to know how to read the arrow keys in Linux. I'm making a test with a program similar to less and I want to use up & down keys for moving through the file, but there's no ASCII code for these keys.
Thanks in advance.
You can also use the series of ascii codes produced from the keys.
Put that in a program and look at the output when you hit the different keys.Code:int ch; while ( (ch=getch()) != EOF ) printf("%x ", ch);
Assuming of course that your compiler actually has getch. To fully answer the question, there is no portable way to read "specially abled" keys from the keyboard, because there is no way to read a single keystroke.
However, if there were, I bet it would be covered in the FAQ, like the origional question is!
Quzah.
Hope is the first step on the road to disappointment.
Opps I meant getchar() But of course when I was testing for that I used that getch() I posted in the linux forum