X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/8da63edfda172244fb15ffd3cf69223fe06d4898..f91fd6d772ee8ea35f833802c9f8cc1db75ca950:/Shiar_Sheet/Keyboard.pm diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm index adaa3dd..aecd0bc 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); @@ -29,13 +29,11 @@ sub new { croak 'No key definitions specified' unless ref $self->{def} eq 'HASH'; $self->{map} ||= 'qwerty'; - my $parent = (caller)[0]; # calling module - my $sign = do { - no strict 'refs'; # temporarily allow variable references - \%{ $parent.'::sign' }; # return %sign from parent + $self->{sign} ||= do { + require Shiar_Sheet::KeySigns; + Shiar_Sheet::KeySigns->VERSION(1.03); + \%Shiar_Sheet::KeySigns::sign; }; - croak "%${parent}::sign not found" unless %$sign; - $self->{sign} = $sign; bless $self, $class; } @@ -94,7 +92,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};