C - Program interface

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

C - Program interface

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

it's a win32 console program. i'll google virtual keys.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

VK_UP, VK_DOWN

:arrow: msdn
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

thanks a bunch for the help
Post Reply