|
From: Ethan A M. <merritt@u.washington.edu> - 2007-06-07 05:01:02
|
On Wednesday 06 June 2007 19:07, Daniel J Sebald wrote: > Ethan Merritt wrote: > > > > The core gnuplot code will never even > > see the <space> keypress event, so it never has the opportunity to decide > > what terminal function to call. The difficulty is all on the input end, > > not the output end. > > > gnuplot tells gplt_x11 to set handle_key_events equal to 0 when it does a > term init, where does the space key get lost? As it is now, the space key does not get lost because gnuplot_x11 will always trap it and act on it. But this makes it unavailable for "bind" because that handling is done *instead of* sending back to gnuplot for use either as a normal keystroke or as a trigger for some previously bound hotkey action. If we change it so that gnuplot_x11 does not treat it as a special case, then it will get lost because: - gnuplot_x11 sees keystroke (happens to be <space> but nothing special about this) - gnuplot_x11 tosses a keystroke event notification into the pipe for gnuplot to read via X11_waitforinput() - if the current terminal is x11, then as the stream of chars in the pipe is gradually read, this one will be directed to event_keypress() for comparison against the list of "bind" actions - but if the current terminal is not x11, nobody will read from the pipe at all. So it is "lost" in the pipe and is never delivered to event_keypress(). Patchset #1500654 "Continue to accept input from previous interactive terminal" tries to work around this by continuing to use X11_waitforinput() as an input source even if x11 is no longer the current terminal. It sort of works so long as x11 is the only interactive terminal in the mix, but when last I looked at it the result of switching to some other interactive terminal was to flood the input stream with garbage characters. I didn't debug it any further, and anyhow the wxt terminal driver has evolved since then. So maybe the patch can be polished up and made more acceptable. If you want to work on the problem, great, but please first explore that patchset and learn why it is necessary and how it works. -- Ethan A Merritt |