/[ttyrec]/jsttyplay/interactive_test.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /jsttyplay/interactive_test.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Tue Feb 17 18:12:32 2009 UTC (15 years, 2 months ago) by dpavlin
File MIME type: text/plain
File size: 792 byte(s)
import upstream from http://encryptio.com/code/jsttyplay

1 dpavlin 1 #!/usr/bin/perl
2     use warnings;
3     use strict;
4    
5     $| = 1;
6    
7     use Term::Emulator;
8     use Term::ReadKey;
9    
10     sub key { ReadMode(4); my $key = ReadKey(-1); ReadMode(0); return $key; }
11     my $term = Term::Emulator->new;
12     $term->spawn("login");
13    
14     my $inttimemin = 0.02;
15     my $inttimemax = 1.00;
16     my $inttimemultstep = 0.001;
17    
18     my $inttime = $inttimemin;
19     my $inttimemult = 1.0;
20    
21     while ( $term->is_active ) {
22     $term->work_for($inttime);
23     $inttime *= ($inttimemult += $inttimemultstep);
24     $inttime = $inttimemax if $inttime > $inttimemax;
25     print "\033[H" . $term->term->as_termstring . "--\n";
26     my $key = key();
27     if ( defined $key ) {
28     $term->key($key);
29     $term->key($key) while defined($key = key());
30     $inttime = $inttimemin;
31     $inttimemult = 1.0;
32     }
33     }
34    
35     print "\nexited\n";
36    

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26