iDevGames Forums
Mac version of getch(); - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Mac version of getch(); (/thread-1082.html)



Mac version of getch(); - Jamie W - Jun 28, 2009 08:03 AM

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.


Mac version of getch(); - unknown - Jun 28, 2009 09:59 AM

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.


Mac version of getch(); - fbronner - Jun 29, 2009 05:33 AM

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