V
Vikram
Hi,
I would like to make a dos program which can directly
interact with the buffer. I mean that there will be a loop
which will constantly check the the buffer for any pressed
key and if there was a key pressed then store it's value.
I tried to use streambuf class but was unable to do so.
Basically I have made a graphical clock(In Dos) and Dos
does not have multithreading capability. So I want to
press the 's' key to stop the clock or erase the clock and
goto some other menu. The problem is that the clock is
itself in a loop state so I have to put the check for
pressed key in the loop. Now cin>> or cin.getline cannot
be used as it will hault the loop until an input is given
and I don't want the clock to stop. I think that this can
only be done if you can directly access the buffer, which
I'm unable to do.
Please do help and if you have a method which does not
require direct buffer accessing then please post it too.
Thanks,
Vikram.
I would like to make a dos program which can directly
interact with the buffer. I mean that there will be a loop
which will constantly check the the buffer for any pressed
key and if there was a key pressed then store it's value.
I tried to use streambuf class but was unable to do so.
Basically I have made a graphical clock(In Dos) and Dos
does not have multithreading capability. So I want to
press the 's' key to stop the clock or erase the clock and
goto some other menu. The problem is that the clock is
itself in a loop state so I have to put the check for
pressed key in the loop. Now cin>> or cin.getline cannot
be used as it will hault the loop until an input is given
and I don't want the clock to stop. I think that this can
only be done if you can directly access the buffer, which
I'm unable to do.
Please do help and if you have a method which does not
require direct buffer accessing then please post it too.
Thanks,
Vikram.