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
  Detecting OS and Mac version xiotex 2 3,050 Nov 14, 2009 03:02 PM
Last Post: xiotex
  Mac version of ... Jamie W 0 1,902 Mar 23, 2009 10:22 AM
Last Post: Jamie W
  What is the OSX version of DirectInput? HelloKitty 7 5,250 Nov 4, 2003 03:22 PM
Last Post: KittyMac
  FMOD - MAC Version Himiona 5 3,588 Apr 25, 2003 08:04 PM
Last Post: Mars_999