X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/77ac3d52d89913a79cca834d882c54a58c15a488..8bf4b29ac2bea396e7aafe10713ec3b148a153a8:/Shiar_Sheet/Keyboard.pm diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm index c5fdb09..44ecc4d 100644 --- a/Shiar_Sheet/Keyboard.pm +++ b/Shiar_Sheet/Keyboard.pm @@ -6,7 +6,7 @@ use warnings; no warnings 'uninitialized'; # save some useless checks for more legible code use Carp; -our $VERSION = 'v2.06'; +our $VERSION = '2.07'; my @casedesc = (undef, qw/shift ctrl meta/, 'shift meta'); my @rowdesc = qw(numeric top home bottom); @@ -36,6 +36,9 @@ sub new { \%Shiar_Sheet::KeySigns::sign; }; + $self->{showkeys} = $PLP::Script::showkeys; + $self->{style } = $PLP::Script::style; + bless $self, $class; } @@ -185,11 +188,43 @@ sub print_legend { my $self = shift; my ($class, $flags) = @_; - print qq{\t\t
\n}; + say qq{\t\t
}; printf("\t\t".'
%s'."\n\t\t\t".'
%s'."\n", $_, map { $self->escapedesc($_) } @{ $self->{flag}->{$_} || ["($_)", '...'] } ) for @$flags; - print "\t\t
"; + say "\t\t
"; +} + +sub print_legends { + my $self = shift; + my ($input) = @_; + + say "
\n"; + say '
'; + + say "\t", '
'; + my @groups = sort grep {/^g\d/} keys %{ $self->{flag} }; + $self->print_legend('legend-types', \@groups); + say "\t
\n"; + + say "\t", '
'; + my @attr = sort grep {!/^g\d/} keys %{ $self->{flag} }; + $self->print_legend('legend-options', \@attr); + say ''; + + say "\t\t", '"; + say "\t
\n"; + say "
\n"; } 1;