|
From: Petr M. <mi...@ph...> - 2014-07-30 14:38:25
|
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?
---
Petr Mikulik
|
|
From: Tatsuro M. <tma...@ya...> - 2014-07-31 11:56:40
|
----- Original Message ----- > From: Petr Mikulik > To: gnuplot-beta <gnuplot-beta > Cc: > Date: 2014/7/30, Wed 23:38 > Subject: pause mouse any: wrong key for MB1 > > 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? gnuplot 4.5.1? Is this 4.4.1 or 4.6.1? Tatsuro |
|
From: Petr M. <mi...@ph...> - 2014-07-31 13:40:51
|
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? --- Petr Mikulik |
|
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
|
|
From: Petr M. <mi...@ph...> - 2014-08-04 07:53:53
|
I have just tried the current cvs to which the enclosed patch has been applied
but all the commands
pause mouse ...
do not work now (gnuplot command prompt is frozen till Ctrl/C).
Can you please repair it?
Thanks, Petr
On Thu, 31 Jul 2014, sfeam wrote:
> 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
|
|
From: sfeam <sf...@us...> - 2014-08-04 15:40:10
|
On Monday, 04 August 2014 09:53:42 AM Petr Mikulik wrote:
> I have just tried the current cvs to which the enclosed patch has been applied
> but all the commands
> pause mouse ...
> do not work now (gnuplot command prompt is frozen till Ctrl/C).
> Can you please repair it?
What terminal and what operating system? 4.6 or 5.0?
Ethan
> Thanks, Petr
>
>
> On Thu, 31 Jul 2014, sfeam wrote:
>
> > 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
|
|
From: Petr M. <mi...@ph...> - 2014-08-04 20:56:58
|
>> I have just tried the current cvs to which the enclosed patch has been applied >> but all the commands >> pause mouse ... >> do not work now (gnuplot command prompt is frozen till Ctrl/C). >> Can you please repair it? > > What terminal and what operating system? 4.6 or 5.0? Cvs of both 4.6 and 5.0. Linux with x11 and wxt terminals. Petr |
|
From: Ethan A M. <sf...@us...> - 2014-08-04 21:36:11
|
On Monday, 04 August, 2014 22:56:47 Petr Mikulik wrote:
> >> I have just tried the current cvs to which the enclosed patch has been applied
> >> but all the commands
> >> pause mouse ...
> >> do not work now (gnuplot command prompt is frozen till Ctrl/C).
> >> Can you please repair it?
> >
> > What terminal and what operating system? 4.6 or 5.0?
>
> Cvs of both 4.6 and 5.0.
> Linux with x11 and wxt terminals.
Very strange.
I don't see any problems here, and I can't fix it if I can't see it.
The patch only touches the code path in which mouse button 1 is clicked.
I could imagine that the new action is not correct for some platform or
some terminal. But I cannot see how the patch can affect mouse commands
that do not involve button 1, nor do I understand how it can affect any
command at all up to the point when mouse button 1 is clicked.
I do notice one thing that possibly is confusing...
When you say "pause mouse {button1|any}" and then
click the mouse, no <cr> is sent to the terminal and
no new prompt is generated.
So it is not obvioud that control has returned to the terminal and a
new command can be typed and executed.
Try this:
type "plot sin(x)"
type "pause mouse any"
type "show variable MOUSE"
No prompt is showing and no output appears yet in the terminals.
Now go the the plot window and left-click the mouse
In response to the mouse click, control will return to the terminal
and the output of "show variable MOUSE" will appear.
Does that not work for you?
Ethan
>
> Petr
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
|
|
From: Petr M. <mi...@ph...> - 2014-08-04 22:22:22
|
>>>> I have just tried the current cvs to which the enclosed patch has been applied
>>>> but all the commands
>>>> pause mouse ...
>>>> do not work now (gnuplot command prompt is frozen till Ctrl/C).
>>>> Can you please repair it?
>>>
>>> What terminal and what operating system? 4.6 or 5.0?
>>
>> Cvs of both 4.6 and 5.0.
>> Linux with x11 and wxt terminals.
>
> Very strange.
> I don't see any problems here, and I can't fix it if I can't see it.
>
> I do notice one thing that possibly is confusing...
> When you say "pause mouse {button1|any}" and then
> click the mouse, no <cr> is sent to the terminal and
> no new prompt is generated.
> So it is not obvioud that control has returned to the terminal and a
> new command can be typed and executed.
Yes, you are right - just the prompt does not go back if a mouse button is
pressed; I thought I have to press Ctrl/C while <Enter> is fine as well.
Now it works fine as well as ginput() in Octave, thanks.
Petr
|