| 1 | package Term::Completion::_readkey; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Term::ReadKey qw(ReadMode ReadKey GetTerminalSize); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | sub set_raw_tty | ||||||||||||||||||||||||||||
| 7 | { | ||||||||||||||||||||||||||||
| 8 | 1 | ▶ | my __PACKAGE__ $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
set_raw_tty: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | ReadMode 4, $this->{in} if -t $this->{in}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 10 | 1 | 1; | |||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | sub reset_tty | ||||||||||||||||||||||||||||
| 14 | { | ||||||||||||||||||||||||||||
| 15 | 1 | ▶ | my __PACKAGE__ $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
reset_tty: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | 1 | ▶ | ReadMode 0, $this->{in} if -t $this->{in}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 1 | 1; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub get_key | ||||||||||||||||||||||||||||
| 21 | { | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | my __PACKAGE__ $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_key: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 0 | ReadKey(0, $this->{in}); | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 2 | ▶ | if($^O =~ /interix|win/i) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 0 | require Term::Completion::_termsize; | |||||||||||||||||||||||||||
| 28 | 0 | *get_term_size = \&Term::Completion::_termsize::get_term_size; | |||||||||||||||||||||||||||
| 29 | } else { | ||||||||||||||||||||||||||||
| 30 | *get_term_size = sub { | ||||||||||||||||||||||||||||
| 31 | 1 | ▶ | my __PACKAGE__ $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=24.5
| |||||||||||||||||||||||||||||
| 32 | 1 | ▶ | if(defined $this->{columns} and defined $this->{rows}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $this->{"columns"} and defined $this->{"rows"}
MC/DC0%0/2
defined $this->{"columns"} and defined $this->{"rows"}
defined $this->{"columns"}
defined $this->{"rows"}
Truth table33%1/3
A and B
A= defined $this->{"columns"}B= defined $this->{"rows"}
| |||||||||||||||||||||||||||||
| 33 | 0 | return($this->{columns}, $this->{rows}); | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 1 | my ($c,$r) = GetTerminalSize($this->{out}); | |||||||||||||||||||||||||||
| 36 | 1 | ▶ | $c ||= $Term::Completion::DEFAULTS{columns}; | ||||||||||||||||||||||||||
|
Condition33%1/3
$c ||= $Term::Completion::DEFAULTS{"columns"}
MC/DC0%0/2
$c ||= $Term::Completion::DEFAULTS{"columns"}
$c
$Term::Completion::DEFAULTS{"columns"}
Truth table33%1/3
A ||= B
A= $cB= $Term::Completion::DEFAULTS{"columns"}
| |||||||||||||||||||||||||||||
| 37 | 1 | ▶ | $r ||= $Term::Completion::DEFAULTS{rows}; | ||||||||||||||||||||||||||
|
Condition33%1/3
$r ||= $Term::Completion::DEFAULTS{"rows"}
MC/DC0%0/2
$r ||= $Term::Completion::DEFAULTS{"rows"}
$r
$Term::Completion::DEFAULTS{"rows"}
Truth table33%1/3
A ||= B
A= $rB= $Term::Completion::DEFAULTS{"rows"}
| |||||||||||||||||||||||||||||
| 38 | return ( | ||||||||||||||||||||||||||||
| 39 | (defined $this->{columns} ? $this->{columns} : $c), | ||||||||||||||||||||||||||||
| 40 | 1 | ▶ | (defined $this->{rows} ? $this->{rows} : $r) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||
| 42 | 2 | }; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 2 | 1; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | __END__ | ||||||||||||||||||||||||||||