diff options
author | dscho <dscho> | 2006-10-10 16:47:24 +0000 |
---|---|---|
committer | dscho <dscho> | 2006-10-10 16:47:24 +0000 |
commit | e6152298e3ecb25b7ac560c5e56c5273e2464dff (patch) | |
tree | 6397892e9801682c2ad0a5e2faf344243bb8cad3 | |
parent | 5092a3b56fe7b5f0a6b181e98756e406aebe2dc6 (diff) | |
download | libtdevnc-e6152298e3ecb25b7ac560c5e56c5273e2464dff.tar.gz libtdevnc-e6152298e3ecb25b7ac560c5e56c5273e2464dff.zip |
VisualNaCro: add 'i', 'c' and 'r' menu keys
-rw-r--r-- | VisualNaCro/ChangeLog | 1 | ||||
-rw-r--r-- | VisualNaCro/recorder.pl | 44 |
2 files changed, 44 insertions, 1 deletions
diff --git a/VisualNaCro/ChangeLog b/VisualNaCro/ChangeLog index c0bd61e..78b9858 100644 --- a/VisualNaCro/ChangeLog +++ b/VisualNaCro/ChangeLog @@ -1,6 +1,7 @@ 2006-10-10: Johannes Schindelin <Johannes.Schindelin@gmx.de> * implement --compact and --compact-dragging to shut up the script about mouse movements or drags. + * add 'i', 'c' and 'r' menu keys. 2006-09-12: Johannes Schindelin <Johannes.Schindelin@gmx.de> * the reference rectangle is selected with a rubber band, diff --git a/VisualNaCro/recorder.pl b/VisualNaCro/recorder.pl index d83551e..01ab3f2 100644 --- a/VisualNaCro/recorder.pl +++ b/VisualNaCro/recorder.pl @@ -108,6 +108,29 @@ sub handle_mouse { } } +sub toggle_text { + my $text = shift; + if ($text eq "Timing") { + return $text . " is " . ($timing ? "on" : "off"); + } elsif ($text eq "Key presses") { + return $text . " are recorded " . ($symbolic ? "symbolically" + : "numerically"); + } elsif ($text eq "Mouse moves") { + return $text . " are recorded " . ($compact ? "compacted" + : "verbosely"); + } elsif ($text eq "Mouse drags") { + return $text . " are recorded " . ($compact ? "compacted" + : "verbosely"); + } + return $text . ": <unknown>"; +} + +$menu_message = "VisualNaCro: press 'q' to quit,\n" + . "'i' to display current settings,\n" + . "'c', 'r' to toggle compact mouse movements or drags,\n" + . "'d' to display current reference image,\n" + . "or mark reference rectangle by dragging"; + while(1) { $result=nacro::waitforinput($vnc,999999); if($result==0) { @@ -135,7 +158,8 @@ while(1) { 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); + nacro::alert($vnc, + $menu_message, 10); } } } else { @@ -193,6 +217,24 @@ while(1) { nacro::alert($vnc, "Error displaying " . $pnm, 10); } + } elsif ($keysym == ord('i')) { + nacro::alert($vnc, "Current settings:\n" + . "\n" + . "Script: $output\n" + . "Server: $server\n" + . "Listening on port: $port\n" + . toggle_text("Timing") . "\n" + . toggle_text("Key presses") . "\n" + . toggle_text("Mouse moves") . "\n" + . toggle_text("Mouse drags"), 10); + } elsif ($keysym == ord('c')) { + $compact = !$compact; + nacro::alert($vnc, + toggle_text("Mouse moves"), 10); + } elsif ($keysym == ord('r')) { + $compact_dragging = !$compact_dragging; + nacro::alert($vnc, + toggle_text("Mouse drags"), 10); } else { nacro::alert($vnc,"Unknown key",10); } |