|
From: <tim...@en...> - 2006-06-04 22:43:32
|
Ethan A Merritt wrote:
> On Sunday 04 June 2006 02:31 am, Petr Mikulik wrote:
> =20
>> I would prefer that this hotkey works always. Could this be organized?
>> =20
>
> So far no one has suggested how this can be done.
> =20
Let's suggest something...
> =20
>> Are not the messages from gnuplot_x11 delivered always to gnuplot?=20
>> =20
>
> Yes, but not immediately.
> It's the same old problem: gnuplot mixes the input streams from the
> keyboard and the current terminal into a single queue. Thus both
> terminal events and keyboard input are read via term->waitforinput().
> If you change the terminal, you change the input routine and no longer
> read events from the previous terminal. =20
> =20
As far as I can tell, term->waitforinput() could be replaced by=20
something like term->processevents(), which would process any pending=20
events and return. Then, this would be called repeatedly by the core=20
after a select() timeout on stdin, or the equivalent functions on=20
different platforms.
Until now, nothing different from what is done currently.
Then, several *term*->processevents() could be called, for each=20
interactive terminal previously initialized. If "term" is the current=20
terminal, all the events
will be processed. Otherwise, only events like "raise" (ie "spacebar=20
pressed" in the default setting) or "close terminal" (ie "q pressed" in=20
the default setting) would be processed.
To sum up : the getc() wrapper is a loop on :
select(...STDIN,TIMEOUT...) on Unix, GetMessage(...) on Windows,=20
SomeEquivalent(...) on OS/2
first_interactive_term->processevents()
second_interactive_term->processevents()
...
Regards,
Timoth=E9e
|