X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/1441526beac2a54af497fb9cc7d7187eeea1a1fa..79f8945f7b66f8cf1ba1f1b84567665a051a76ff:/Shiar_Sheet/Keyboard.pm diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm index d8d8274..6ba2a4a 100644 --- a/Shiar_Sheet/Keyboard.pm +++ b/Shiar_Sheet/Keyboard.pm @@ -5,11 +5,13 @@ use warnings; no warnings 'uninitialized'; # save some useless checks for more legible code use Carp; -our $VERSION = '1.01'; +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 @@ -45,6 +47,7 @@ sub map { sub escapeclass { local $_ = shift; s/\^/_c/g; + s/\+/_m/g; s/\[/_sbo/g; s/\]/_sbc/g; s/^$/_/; @@ -63,7 +66,7 @@ sub keyunalias { 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};