View Full Version : Get a single character from stdin without hitting ENTER, need help.
abeo
January 15th, 2009, 11:55 PM
Im new to C programming under Linux environment. Im trying to write a simple program that can test my keyboard. To do that, i wanna get a single character from stdin (when i press a button) and print it on the screen of the terminal, but without having to press an extra ENTER. I've used getc, getchar, getch (ncurses.h), but none of them working. Someone know the solution for my case? Any help will be appreciated. Thanks for reading my question.
stumbleUpon
January 16th, 2009, 12:48 AM
Will this help?
http://ou800doc.caldera.com/en/SDK_charm/_getch.html
abeo
January 16th, 2009, 06:21 AM
Ok, i'll try it. Thanks for your reply.
rajan
January 16th, 2009, 08:38 PM
in the future, try http://ubuntuforums.org/forumdisplay.php?f=39 .... it's a different sub-forum of this site and it's really good for programming help. the people that look at it are very good and very helpful.
abeo
January 17th, 2009, 02:40 AM
Oh right, I didnt see the sub-forum when i started the topic. I'll try in the right place from now on. Thanks for your reply, rajan.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.