P
parcour
Hi. I wonder if anyone could point me to a simple key mapping example
for a command-line application. I would like to map the up and down
arrow keys in my application to a couple of command history functions,
but I don't know how to interact with the terminal (any terminal) to do
this. If I use getc to trap an arrow key press I just get an ESC (27),
and of course I have to wait for a newline to do anything with it.
I've been looking over vim and mysql source for an answer, but it's a
lot of code to wade through. Thanks for any tips.
for a command-line application. I would like to map the up and down
arrow keys in my application to a couple of command history functions,
but I don't know how to interact with the terminal (any terminal) to do
this. If I use getc to trap an arrow key press I just get an ESC (27),
and of course I have to wait for a newline to do anything with it.
I've been looking over vim and mysql source for an answer, but it's a
lot of code to wade through. Thanks for any tips.