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 |
|