Skip to content

Commit

Permalink
fix read_mouse for Gnuplot 6
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Sep 18, 2024
1 parent 5e2c880 commit d0453cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- handle Gnuplot 6 warnings about Qt plugins
- Gnuplot 6: handle warnings about Qt plugins, fix read_mouse

2.027 2024-07-31
- add "resample" curve option for with=>'fits'
Expand Down
6 changes: 3 additions & 3 deletions lib/PDL/Graphics/Gnuplot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4265,7 +4265,7 @@ EOC
$string = _checkpoint($this, "main", {notimeout=>1});

$string =~ m/Key: (\-?\d+)( +at xy:([^\s\,]+)\,([^\s\,]+)? button:(\d+)? shift:(\d+) alt:(\d+) ctrl:(\d+))?\s*$/
|| barf "read_mouse: string $string doesn't look right - doesn't match parse regexp.\n";
|| barf "read_mouse: string '$string' doesn't look right - doesn't match parse regexp.\n";

($ch,$x,$y,$b,$sft,$alt,$ctl) = map $_//"", ($1,$3,$4,$5,$6,$7,$8);

Expand All @@ -4284,8 +4284,8 @@ EOC
$string = _checkpoint($this, "main", {notimeout=>1});
$string =~ s/[\r\n]/ /sg;

$string =~ m/Key:(\-?\d+)( +at xy:([^\s\,]+)\,([^\s\,]+) shift:(\d+) alt:(\d+) ctrl:(\d+))?/
|| barf "read_mouse: string $string doesn't look right - doesn't match parse regexp.\n";
$string =~ m/Key:\s*(\-?\d+)( +at xy:\s*([^\s\,]+)\s*\,\s*([^\s\,]+) shift:\s*(\d+) alt:\s*(\d+) ctrl:\s*(\d+))?/
|| barf "read_mouse: string '$string' doesn't look right - doesn't match parse regexp.\n";

($ch,$x,$y,$sft,$alt,$ctl) = map $_ // "", ($1,$3,$4,$5,$6,$7);

Expand Down

0 comments on commit d0453cb

Please sign in to comment.