I want to make a notepad type console application, and in order to format, you would need to not let Enter submit the string. Is there a way to disable enter and finnish editing the string after a different key press such as Alt+8?
Thanks.
I want to make a notepad type console application, and in order to format, you would need to not let Enter submit the string. Is there a way to disable enter and finnish editing the string after a different key press such as Alt+8?
Thanks.
You will have to use the windows.h library.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Well, you can have a EOF designator and just parse the entered string for that designator. If it isn't there, then just accept more input and append it to the previous input.
That way you don't have to use platform specific code. And unless you are on a really old computer, parsing even 20 lines should take... oh 0.0 secs
umm.... how do you do that
Ummm... google.
You can also do it with conio.h, though it isn't standard. Take the character in unbuffered and print them out as they come in (as if they were coming in as buffered input)... when you take in an ENTER, just do nothing. When you take in an F8, process it as a flush command.
Here is a little example program I wrote that shows how conio.h's getch function works with extended characters. It's old and I've posted it before but it might help you out. If you don't have conio.h (You can't compile the code), then just ignore this.
Last edited by SlyMaelstrom; 09-29-2006 at 04:20 PM.
Sent from my iPad®