Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
newbie Q - how to wait for keystroke in gcc/xcode ??
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="binkley" data-source="post: 33805"><p>I threw together this test program quickly using curses. The only annoying aspect is that it clears the screen when "initscr()" is called.</p><p></p><p>[CODE]#include <curses.h></p><p>int main() {</p><p> int c;</p><p></p><p> initscr();</p><p></p><p> c = getch();</p><p> printf("\r\nGot character: %c.\r\n", c);</p><p></p><p> return 0;</p><p>}</p><p>[/CODE] </p><p></p><p> Compile with "gcc getch.c -lcurses". Hope that helps.</p></blockquote><p></p>
[QUOTE="binkley, post: 33805"] I threw together this test program quickly using curses. The only annoying aspect is that it clears the screen when "initscr()" is called. [CODE]#include <curses.h> int main() { int c; initscr(); c = getch(); printf("\r\nGot character: %c.\r\n", c); return 0; } [/CODE] Compile with "gcc getch.c -lcurses". Hope that helps. [/QUOTE]
Verification
What is Apple's smallest desktop computer called?
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
newbie Q - how to wait for keystroke in gcc/xcode ??
Top