You are not logged in.
Hi,
I am coding a small device manager for my personal use ( fun and exercise ). Right now a panel is used to display devices, whether they are removable or static (hard drive). My idea is to move a curser (up and down) to highlight the selected line. But I don't see any function in curses to achieve this.
Do I need to move an other but highlighted panel, which needs to be filled after every movement with the content of the bottom line or is there a better way?
I hope there are some curses coder out there!
Thanks for every help in advance
L-K
Offline
I always use the mvchgat (or mvwchgat) function to highlight lines.
man curs_attr
might help.
Offline
This sounds promising. I will give it a try. It should be much faster than my unluckily proposed moving panel.
Last edited by linux-ka (2011-07-05 15:46:34)
Offline
Great, this works realy great.
But I have got a serious issue with KEY_UP and KEY_DOWN. It is not recognized when entering those keys. KEY_LEFT and KEY_RIGHT are in the same way ignored when being pressed. Have you ever had the same problem?
Offline
Can't say I have, but which input option functions do you call? cbreak, nocbreak, raw, keypad?
man curs_inopts
might help this time
man ncurses
might be helpful more generally and of course http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ might help (I know its for C, but since ncurses is a C library anyway, that should be much of a problem, right?)
Offline
I am using
keypad(stdscr,1);
cbreak();
With respect to the man page it should be enough to work with function keys.
EDIT:
I tried to use F1-F9...and it doesn't work as well.
EDIT2:
Got it. My problem was that keys were fetched via getchar instead of getch. Using getch or wgetch everthing is ok.
Last edited by linux-ka (2011-07-08 19:43:21)
Offline