Hi guys, I'm tired as shit, but trying to finish part of the C assignment I have... The problem is this: I need to read input from keyboard, only one character at a time, but without waiting for user to press enter.
Program is drawing an ascii box on screen with '+' inside, and based on the user input program moves it in desired direction... the only problem is that user needs to press enter after each input :)
I'm tired as hell and off to sleep soon, but I'm affraid it will keep bugging me so I won't be able to sleep and will instead go research streams... and that would not be a good choice for me currently, so - many internets to anyone who helps :))
Sorry for my bad english...
many internets to anyone who helps :)) Return to /b/,please.
Name:
Anonymous2008-08-28 19:21
OP here, found it... getche() function :)
It's unbuffered (doesn't wait for newline) and echoing (echoes every character directly on stdout)...
It's deprecated, old, but it works for now... hah! Off to sleep now.
Name:
Anonymous2008-08-28 19:22
Use ncurses. It has a getch function that isn't line buffered. I believe you have to let ncurses know that you want this by calling the cbreak function.
Name:
Anonymous2008-08-28 21:42
Use [b][u][o][i]ENTERPRISE[/i][/o][/u][/b]. It has a [b][u][o][i]CUSTOMER-ORIENTED SCALABLE TURKEY getCh[/i][/o][/u][/b] solution that isn't line buffered. I believe you have to let [b][u][o][i]ENTERPRISE[/i][/o][/u][/b] know that you want this by calling the [b][u][o][i]EXPERT CUSTOMIZABLE DEMAND-DRIVEN DISTRIBUTED WEB SERVICE ORIENTED cBreak[/i][/o][/u][/b] function.
Use ENTERPRISE. It has a CUSTOMER-ORIENTED SCALABLE TURKEY getCh solution that isn't line buffered. I believe you have to let ENTERPRISE know that you want this by calling the EXPERT CUSTOMIZABLE DEMAND-DRIVEN DISTRIBUTED WEB SERVICE ORIENTED cBreak function.
Name:
Anonymous2008-08-28 21:58
Obviously the expedited retrieval of key business information from the console for improved customer satisfaction is a highly-demanded solution in today's customer-facing applications. You should formulate a strategy going forward to enrich your learns in order to gather the momentum to most effectively facilitate and leverage the synergies between turnkey business-ready solutions such as ncurses and the terminal emulator, followed by employing the cbreak pattern to deoperationalize the line-buffering service. That's how I'd go about it, anyway.