From 84b3a4a7544017fd8cd9d91798b9ff1ac08d5a37 Mon Sep 17 00:00:00 2001 From: dscho Date: Tue, 12 Sep 2006 17:30:37 +0000 Subject: VisualNaCro: add magic key 'd' to display the current reference image --- VisualNaCro/recorder.pl | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'VisualNaCro/recorder.pl') diff --git a/VisualNaCro/recorder.pl b/VisualNaCro/recorder.pl index 53dfbc2..6573a9a 100644 --- a/VisualNaCro/recorder.pl +++ b/VisualNaCro/recorder.pl @@ -112,12 +112,14 @@ while(1) { } } if($keysym==0xffe3 || $keysym==0xffe4) { - # Control pressed - $magickey++; - if($magickey>3 && !$keydown) { - $magickey=0; - $mode="menu"; - nacro::alert($vnc,"VisualNaCro: press 'q' to quit\nor mark reference rectangle by dragging",10); + if (!$keydown) { + # Control pressed + $magickey++; + if ($magickey > 1) { + $magickey = 0; + $mode = "menu"; + nacro::alert($vnc,"VisualNaCro: press 'q' to quit,\n'd' to display current reference image,\nor mark reference rectangle by dragging",10); + } } } else { $magickey=0; @@ -160,8 +162,18 @@ while(1) { close OUT; nacro::closevnc($vnc); exit 0; + } elsif ($keysym == ord('d')) { + $pnm=$output.($image_counter - 1).".pnm"; + $res = nacro::displaypnm($vnc, $pnm, + $x_origin, $y_origin, 1, 10); + #0, 0, 1, 10); + if ($res == 0) { + nacro::alert($vnc, "Error displaying " + . $pnm); + } + } else { + nacro::alert($vnc,"Unknown key",10); } - nacro::alert($vnc,"Unknown key",10); $mode="passthru"; } if($result&$nacro::RESULT_MOUSE) { -- cgit v1.2.1