Page 1 of 1

C - Program interface

Posted: Fri Oct 01, 2004 7:03 pm
by nigma
Pretend i've got the following prompts that I want to display to a user:
Full Name:
Address:
Phone Number:

I'd like to make it so that the user can use the up/down arrow keys to navigate through prompts. I'm thinking that in order for this to be done i'd need to somehow turn off buffers so that I could "listen" for an up/down keypress and then move the cursor up/down a line? If so how can I do that?

Posted: Fri Oct 01, 2004 7:34 pm
by feyd
Is this entirely command line, or is it a win32 console program?

If it's a console program, you can use the virtual keys. If not, IIRC, you'll need some assembly to access the keyboard interupt and "watch" it for the keys, which are actually double-byte codes.

Posted: Fri Oct 01, 2004 7:36 pm
by nigma
it's a win32 console program. i'll google virtual keys.

Posted: Fri Oct 01, 2004 7:38 pm
by feyd
VK_UP, VK_DOWN

:arrow: msdn

Posted: Fri Oct 01, 2004 7:41 pm
by nigma
thanks a bunch for the help