当我发布<条码>Up-key时,本字母(。 术语:TermKey输出You pressed: <Up>
。
#!/usr/bin/env perl
use warnings;
use 5.012;
use Term::TermKey;
my $tk = Term::TermKey->new( *STDIN );
say "Press any key";
$tk->waitkey( my $key );
say "You pressed: <" . $tk->format_key( $key, 0 ) . ">";
How could I reach the same result with Win32::Console?
I tried this, but it worked only on "normal" keys like l
,k
, ... but not with keys like Up
, Delete
, ...
use Win32::Console;
my $in = Win32::Console->new(STD_INPUT_HANDLE);
$in->Mode(ENABLE_PROCESSED_INPUT);
my $result = $in->InputChar(1);
say "<$result>";
我怎么能够把工作钥匙如<代码>Up,Delete
,...也与Win32:Console
一起?