git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
support (shift+)meta (alt) key combinations
[sheet.git]
/
Shiar_Sheet
/
Keyboard.pm
diff --git
a/Shiar_Sheet/Keyboard.pm
b/Shiar_Sheet/Keyboard.pm
index 3aa18833b477710a74f071376b9bada3a0d2c910..6ba2a4ad12674ad04674e9cb3133d3624a309adb 100644
(file)
--- 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;
no warnings 'uninitialized'; # save some useless checks for more legible code
use Carp;
-our $VERSION = '1.0
1
';
+our $VERSION = '1.0
2
';
-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';
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
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;
sub escapeclass {
local $_ = shift;
s/\^/_c/g;
+ s/\+/_m/g;
s/\[/_sbo/g;
s/\]/_sbc/g;
s/^$/_/;
s/\[/_sbo/g;
s/\]/_sbc/g;
s/^$/_/;
@@
-63,7
+66,7
@@
sub keyunalias {
my $self = shift;
my ($key, $ancestry) = @_;
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};
my $mode = $1;
my $keyinfo = $self->{keys}->{$mode}->{$key};
@@
-163,13
+166,13
@@
Shiar_Sheet::Keyboard - Output HTML for key sheets
=head1 DESCRIPTION
=head1 DESCRIPTION
-Used by http://sheet.shiar.n
et
to display keyboard sheets.
+Used by http://sheet.shiar.n
l
to display keyboard sheets.
Assumes specific stylesheets and javascript from this site,
so probably not of much use elsewhere.
=head1 AUTHOR
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
=head1 LICENSE