Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Real Tim IO and other CLI topics

Real Tim IO and other CLI topics
Thread Tools
Professional Poster
Join Date: Jul 2001
Location: Dis
Status: Offline
Reply With Quote
Nov 21, 2001, 09:24 PM
 
All of the input functions I learned in C require that the user hit return before the program will continue execution. Suppose I want to get the first character the user hits and act on it without the user having to hit enter. What function would I use to do that? Is there a function in the standard libraries that will do that?

How do I highlight text that I'm printing to the screen? Is there some sort of format string in printf?

Last, is it possible to refresh the text on screen without having to reprint every character? How? For instance, I noticed that when I'm scrolling down in Emacs, Emacs doesn't have to reprint every character on screen when I scroll down a bit.

Thanx
BlackGriffen
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. -Galileo Galilei, physicist and astronomer (1564-1642)
     
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Nov 22, 2001, 01:56 PM
 
Take a look at getchar().

And the Terminal uses ANSI commands for that, the ncurses-library was built for supporting developers in these tasks.
     
Professional Poster
Join Date: Jul 2001
Location: Dis
Status: Offline
Reply With Quote
Nov 23, 2001, 02:17 PM
 
Every time I've used getchar(), the user had to hit enter to get the program to continue execution, and I had to use a second getchar to remove the \n. Is the stall because I'm using printf?

BlackGriffen
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. -Galileo Galilei, physicist and astronomer (1564-1642)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2