How I can read when the user press an arrows keys in c/c++?
thx
Lollo
How I can read when the user press an arrows keys in c/c++?
thx
Lollo
As long as you are reading the "raw keys", you should be able to read out the escape-sequence of the keys. In normal mode, you are reading the "cooked" result of the input, so you don't get individual key-presses, but rather the input that the IO subsystem has "cooked" for you.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
can you show me a snippet which do that I need?
thx
It's worth noting here that the escape sequences are "multicharacter" sequences, so you will either have to read multiple characters with a timeout when there's nothing more to read, or parse the input intelligently.
Another option is to use some sort of curses library - ncurses for example.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Ok...I use ncurses...
I'm using eclipse to develope...using ncurser when use the function
"initscr"
I get
"Error opening terminal: unknown."
...why?
Not sure, what terminal type is it reporting?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
eclipse use his embedded console...perhaps is this the problem