![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get capture input events from keyboard and mouse | yhacks | High Level Programming | 4 | 05-26-2008 04:31 AM |
| Keyboard Input | cpaquette | High Level Programming | 4 | 04-07-2008 10:44 AM |
| Don't show keyboard input on terminal | marianor31 | Shell Programming and Scripting | 1 | 03-23-2007 03:54 PM |
| suppressing keyboard input | anthreedhr | Shell Programming and Scripting | 1 | 10-21-2004 08:05 AM |
| How can I map Unix keyboard for PC keyboard | simhab | UNIX for Advanced & Expert Users | 1 | 03-06-2002 08:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Detecting Keyboard Input without return
Hi,
I need a way to detect the up and down arrow key inputs for my program. I do not want to wait for the return key to be entered(so that rules out getch() and family). Also I need to process several of these inputs in parallel, by servicing each request with a thread. Is that possible? -Ravneet |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
See this post - it allows reading any key as it is pressed, without hitting return.
unbuffered streams. |
|
#3
|
|||
|
|||
|
I suggest you look up terminal functions such as 'cfmakeraw()'.
|
|
#4
|
|||
|
|||
|
Jim,
Two things, firstly I don't want to echo my input on the screen. This seems to do that. Second, I still can't seem to get my output without pressing enter. Another strange thing that I notice is that I need to enter atleast 4 characters (and enter thereafter) to see the output. Does that have to do with stream buffering by any chance? Do I need to set it to unbuffered? Porter, I looked up the termios library function which you have suggested. While tcsetattr and tcgetattr seem to work fine, I get a symbol reference error for cfmakeraw. However I tried by directly doing what cfmakeraw does, and that also does not solve my problem. |
|
#5
|
||||
|
||||
|
Quote:
|
||||
| Google The UNIX and Linux Forums |