vi: move legend data to translations include
[sheet.git] / Shiar_Sheet / Keyboard.pm
index 760733595c4d7cf2a0351613544d766e23d32b9b..7713009487f108a9732de3cc61c783b3cf85ce2f 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 no  warnings 'uninitialized';  # save some useless checks for more legible code
 use Carp;
 
-our $VERSION = 'v2.00';
+our $VERSION = 'v2.01';
 
 my @casedesc = (undef, qw/shift ctrl meta/, 'shift meta');
 my @rowdesc = qw(numeric top home bottom);
@@ -168,6 +168,17 @@ sub print_rows {
        } # row
 }
 
+sub print_legend {
+       my $self = shift;
+       my ($class, $flags) = @_;
+
+       print qq{\t\t<dl class="legend $class">\n};
+       printf("\t\t".'<dt class="%s">%s'."\n\t\t\t".'<dd>%s'."\n",
+               $_, @{ $self->{flag}->{$_} || ["($_)", '...'] }
+       ) for @$flags;
+       print "\t\t</dl>";
+}
+
 1;
 
 =head1 NAME