X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/0891e329b2f7d14c7ae8b8cdbefda513d1d796a7..1c9e4de248f4c75b4ee27c851844807bece9b33e:/Shiar_Sheet/Keyboard.pm?ds=sidebyside
diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm
index 6819236..e8e33aa 100644
--- a/Shiar_Sheet/Keyboard.pm
+++ b/Shiar_Sheet/Keyboard.pm
@@ -5,7 +5,7 @@ use warnings;
no warnings 'uninitialized'; # save some useless checks for more legible code
use Carp;
-our $VERSION = 'v2.02';
+our $VERSION = 'v2.03';
my @casedesc = (undef, qw/shift ctrl meta/, 'shift meta');
my @rowdesc = qw(numeric top home bottom);
@@ -94,7 +94,7 @@ sub print_key {
}
my ($flags, $desc, $mnem) = @{$flags};
if (my $txt = $self->{key}->{$mode.$key}) {
- ($desc, $mnem) = @{$txt};
+ ($desc, $mnem) = split /\n/, $txt;
}
# $key = $keytrans{$key} if defined $keytrans{$key};
@@ -113,7 +113,7 @@ sub print_key {
);
$flags .= ' chr'.ord(substr $key, -1) if $key ne '^0';
- print qq{\t\t
$keytxt};
+ print qq{\t\t$keytxt};
print "\n";
}
@@ -126,12 +126,12 @@ sub print_rows {
my $defrows = shift || [2, 1, 0];
my @modes = sort keys %{ $self->{def} };
- print ''."\n\n";
+ print ''."\n\n";
for (my $row = -1; $row <= $#{ $keyrows{$self->{map}} }; $row++) {
my $keyrow = $row < 0 ? [["\e"]] : $keyrows{$self->{map}}->[$row];
- printf qq{\n}, $row+1;
+ printf qq{\n}, $row+1;
for my $basemode (@modes) {
my @moderows = split /\s+/,
$row < 0 ? "0" :
@@ -147,30 +147,30 @@ sub print_rows {
for my $case (@caserows) {
my $keycase = $keyrow->[$case] or next;
@$keycase or next;
+ my @caseclass;
+ push @caseclass, 'mode', 'mode'.escapeclass($basemode) if $basemode ne '';
+ push @caseclass, 'lead' if defined $modekeys->{lead}; # leading command key shown
+ push @caseclass, $casedesc[$case] if defined $casedesc[$case];
- printf "\t- ", $basemode ne '' && sprintf(
- ' class="%s"', 'mode mode' . escapeclass($basemode)
+ printf "\t
", @caseclass > 0 && sprintf(
+ ' class="%s"', join ' ', @caseclass
);
- printf('%s: %s', # XXX insert here to fix msie<=6
+ printf('%s: %s | ', # XXX insert here to fix msie<=6
$self->{mode}->{$mode} || "mode $basemode",
"$rowdesc[$row] row $casedesc[$case]"
) unless $row < 0;
print "\n";
- my $caseclass = 'keys';
- $caseclass .= ' lead' if defined $modekeys->{lead}; # leading command key shown
- $caseclass .= " $casedesc[$case]" if defined $casedesc[$case];
- print qq{\t\t\n};
$self->print_key($mode, $_, $modekeys->{$_}) for @$keycase;
- print qq{\t\t \n};
+ print qq{\t\t \n};
} # case
} # submode
} # basemode
- print qq{\t\n};
+ print qq{\t \n};
} # row
- print " \n";
+ print " \n";
}
sub print_legend {
|