|
From: sfeam <sf...@us...> - 2014-08-01 05:20:09
|
On Thursday, 31 July 2014 03:40:40 PM Petr Mikulik wrote:
> More observation for various gnuplot versions:
>
> 4.6.1: MB1 returns correct value
>
> 4.6.2 - 4.6.4: "pause mouse any" ignores MB1
> "pause mouse button1" never ends
>
> 4.6.5: pause mouse works, but returns incorrect value of MB1
>
>
> (I have found this problem as ginput() of Octave broke after a change of
> gnuplot binary from /usr/bin (OpenSUSE 12.3) to /usr/local/bin.)
>
> > ----- Original Message -----
> >> I've noticed that
> >> plot x
> >> pause mouse any
> >> show var
> >>
> >> does not work correctly if you click MB1; it produces
> >> MOUSE_KEY = 1063
> >> MOUSE_CHAR = "'"
> >> instead of
> >> MOUSE_BUTTON = 1
> >> MOUSE_KEY = 1
> >> MOUSE_CHAR = "\001"
> >>
> >> It works fine for gnuplot 4.5.1 but is wrong in the latests releases including
> >> cvs, using all x11, wxt and qt terminals.
> >>
> >> What's going wrong?
I don't have time to test this properly, but the following may fix it.
%%%%%%
--- gnuplot/src/mouse.c 2014-07-22 22:45:48.000000000 -0700
+++ gnuplot-cvs/src/mouse.c 2014-07-31 22:15:36.096081154 -0700
@@ -1816,7 +1816,13 @@ event_buttonpress(struct gp_event_t *ge)
} else if (ALMOST2D) {
if (!setting_zoom_region) {
if (1 == b) {
- /* not bound in 2d graphs */
+ /* "pause button1" or "pause any" takes precedence over key bindings */
+ if (paused_for_mouse & PAUSE_BUTTON1) {
+ load_mouse_variables(mouse_x, mouse_y, TRUE, b);
+ event_reset(ge);
+ return;
+ }
+
} else if (2 == b) {
/* not bound in 2d graphs */
} else if (3 == b &&
%%%%%%
Ethan
|