X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=14c945a58987edabecd084078caf58eedca9ed38;hb=2af6cce23d91c175f9fe9a5b4f7af6f8cfd43440;hp=29817564533c95cd37b243435c683c13c06409ab;hpb=46001b2fa7ddb237001a9f661faca4885f9daf9d;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index 29817564..14c945a5 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -186,7 +186,7 @@ sub rec_stdin } else { beep(); } - } elsif ($r eq KEY_PPAGE || $r eq "\026") { + } elsif ($r eq KEY_PPAGE || $r eq "\032") { if ($spos > 0) { $spos -= $pages; $spos = 0 if $spos < 0; @@ -194,7 +194,7 @@ sub rec_stdin } else { beep(); } - } elsif ($r eq KEY_NPAGE || $r eq "\032") { + } elsif ($r eq KEY_NPAGE || $r eq "\026") { if ($spos < @shistory - 1) { $spos += $pages; $spos = @shistory if $spos > @shistory; @@ -216,6 +216,8 @@ sub rec_stdin } } elsif ($r eq KEY_HOME || $r eq "\001") { $pos = 0; + } elsif ($r eq KEY_END || $r eq "\005") { + $pos = $lth; } elsif ($r eq KEY_BACKSPACE || $r eq "\010") { if ($pos > 0) { my $a = substr($inbuf, 0, $pos-1); @@ -250,11 +252,14 @@ sub rec_stdin $pos++; $lth++; } elsif ($r eq "\014" || $r eq "\022") { + $top->touchwin(); + $bot->touchwin(); $scr->touchwin(); $scr->refresh(); + $top->refresh(); } elsif ($r eq "\013") { - $inbuf = ""; - $pos = $lth = 0; + $inbuf = substr($inbuf, 0, $pos); + $lth = length $inbuf; } else { beep(); }