Mac version of getch();

Member
Posts: 129
Joined: 2009.03
Post: #1
I'm developing a command line app, it's for Windows and Mac. When the app finishes running, it prints out a message requesting user to press any key to exit..

On Windows, I've used getch(); but (afaik) this is a Microsoft thing and there's no equivalent in OSX, or is there? Anyhoo, if anyone has any suggestions, how to just wait for a key-press on OSX, that'd be super!

Cheers.
Jamie.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
type
Code:
man getch
in Terminal.app and it talks about what you need to include to get it, what the function does etc etc.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2009.06
Post: #3
Jamie W Wrote:I'm developing a command line app, it's for Windows and Mac. When the app finishes running, it prints out a message requesting user to press any key to exit..

On Windows, I've used getch(); but (afaik) this is a Microsoft thing and there's no equivalent in OSX, or is there? Anyhoo, if anyone has any suggestions, how to just wait for a key-press on OSX, that'd be super!

Cheers.
Jamie.

Hi Jamie,

Sorry to disturb your bubble, but I was programming on Unix back in 1987 using the getch() function. It is available on all Unixes as long as you include the curses.h file which provides you with interaction to the console and terminal.

Microsoft has nothing to do with this, it predates them by quite a number of year... :-)

Regards,
Frederic
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Mac version of ... Jamie W 0 1,813 Mar 23, 2009 10:22 AM
Last Post: Jamie W