no warnings 'uninitialized'; # save some useless checks for more legible code
use Carp;
-our $VERSION = '1.00';
+our $VERSION = '1.02';
-my @casedesc = qw(ctrl shift);
+my @casedesc = (undef, qw/shift ctrl meta/, 'shift meta');
my @rowdesc = qw(numeric top home bottom);
my %keyrows = do 'keys.inc.pl';
+# add first two cases of each row again with each char prepended by + (alt)
+push @$_, map { [map {"+$_"} @$_] } @$_[0,1] for map {@$_} values %keyrows;
my %keytrans = qw(
^@ NUL ^a SOH ^b STX ^c ETX ^d EOT ^e ENQ ^f ACK ^g BEL
sub escapeclass {
local $_ = shift;
s/\^/_c/g;
+ s/\+/_m/g;
s/\[/_sbo/g;
s/\]/_sbc/g;
s/^$/_/;
my $self = shift;
my ($key, $ancestry) = @_;
- $key =~ s/(\S*?)(\^?\S)($|\s.*)/$2/;
+ $key =~ s/(\S*?)(\+?\^?\S)($|\s.*)/$2/;
my $mode = $1;
my $keyinfo = $self->{keys}->{$mode}->{$key};
# $key = $keytrans{$key} if defined $keytrans{$key};
my $keytxt = $mode . escapehtml($key) if $key ne '^0';
- $keytxt .= $self->{sign}->{arg} while $flags =~ s/ ?\barg\b//; # argument
+ $keytxt .= $self->{sign}->{$1} while $flags =~ s/(?:^| )(arg[a-ln-z]?)\b//; # arguments
$keytxt .= "<small>$self->{sign}->{motion}</small>" if $flags =~ s/ ?\bargm\b//; # motion argument
$keytxt =~ s{\^(?=.)}{<small>^</small>}; # element around ctrl-identifier
my $onclick = $flags =~ s/ ?\bmode(\S*)// && defined $self->{keys}{$1} && sprintf(
=head1 DESCRIPTION
-Used by http://sheet.shiar.net to display keyboard sheets.
+Used by http://sheet.shiar.nl to display keyboard sheets.
Assumes specific stylesheets and javascript from this site,
so probably not of much use elsewhere.
=head1 AUTHOR
-Mischa POSLAWSKY <perl@shiar.org>
+Mischa POSLAWSKY <perl@shiar.nl>
=head1 LICENSE