X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/d3b21c80d4dbf66130064f4688f79f0ba7b22c41..c11640facf0c976140547ef1b58971ec8a661dd3:/Shiar_Sheet/Keyboard.pm diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm index 05df107..4bc142c 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 = '1.03'; +our $VERSION = 'v1.04'; my @casedesc = (undef, qw/shift ctrl meta/, 'shift meta'); my @rowdesc = qw(numeric top home bottom); @@ -107,28 +107,37 @@ sub print_key { sub print_rows { my $self = shift; - my $static = shift; - my @moderows = $static ? split(/\s+/, $static) : sort keys %{ $self->{keys} }; + my %moderows = ( + -DEFAULT => !@_ ? '' : split(/(?:\s*([^=\s]*)=\s*)/, shift), + # plus specific mode overrides prefixed by '=' + ); + my $defrows = shift || [2, 1, 0]; + my @modes = sort keys %{ $self->{keys} }; for (my $row = 0; $row <= $#{ $keyrows{$self->{map}} }; $row++) { my $keyrow = $keyrows{$self->{map}}->[$row]; print qq{
  • \n}; } # case - } # mode + } # submode + + } # basemode print qq{\t\n}; } # row }