summaryrefslogtreecommitdiffstats
path: root/VisualNaCro/recorder.pl
diff options
context:
space:
mode:
authordscho <dscho>2006-09-12 17:30:37 +0000
committerdscho <dscho>2006-09-12 17:30:37 +0000
commit84b3a4a7544017fd8cd9d91798b9ff1ac08d5a37 (patch)
tree4fc999f18f3e9c8df5fdc0c5d724aa590aac0d83 /VisualNaCro/recorder.pl
parent427e3de154fae89012e1627ca2c95046ef75f7ec (diff)
downloadlibtdevnc-84b3a4a7544017fd8cd9d91798b9ff1ac08d5a37.tar.gz
libtdevnc-84b3a4a7544017fd8cd9d91798b9ff1ac08d5a37.zip
VisualNaCro: add magic key 'd' to display the current reference image
Diffstat (limited to 'VisualNaCro/recorder.pl')
-rw-r--r--VisualNaCro/recorder.pl26
1 files changed, 19 insertions, 7 deletions
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) {