这为主要压力而不是烟雾。 我应在此作什么改动,以使之发挥作用(。 术语:TermKey?
#!/usr/bin/env perl
use warnings;
use 5.12.0;
use utf8;
use Term::TermKey qw(FLAG_UTF8);
my $tk = Term::TermKey->new( *STDIN );
binmode STDOUT, :encoding(utf-8) if $tk->get_flags & FLAG_UTF8;
while( 1 ) {
my $key;
$tk->waitkey( $key );
if ( $key->type_is_mouse ) {
my ( $ev, $button, $line, $col ) = $tk->interpret_mouse( $key );
say "event : $ev";
say "button: $button";
say "line : $line";
say "col : $col";
}
else {
say "<", $tk->format_key( $key, 0 ), ">";
}
}