Hello Rooters,
I was wondering wether there is a function that reads the keyboard buffer.
The problem is the following:
I have a program running through datafiles, analyzing them. If a certain condition is met I want to pause the program until a keyboard key is hit. Meanwhile I want to plot a histogram in a Canvas.
I was thinking about a pause function like this (very dirty, because its just a thought):
void myCustomClass::pause()
{
TCanvas *mycan = new TCanvas("p","t",5);
mycan->cd();
hist->Draw() // hist is defined elsewhere in this class
bool kbhit=false;
while(!kbhit)
{
gSystem->ProcessEvents();
kbhit = kbbufferisfull() // this is the function that I am looking for
gSystem->Sleep(50);
}
delete mycan;
}
As you can see, I need a “kbbufferisfull()” function in order for this little function to work. Is there already something that does the job for me, that I was missing during my search? Or is there a better way to accomplish what I am trying to do?
Thank you
Lutz