X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/b3b71de70835c9edbdf320035d5bb54d4c31db46..78535a7725d2dbf3c0377b9d8069773349ca8c12:/tools/mkcharinfo?ds=sidebyside diff --git a/tools/mkcharinfo b/tools/mkcharinfo index da6aa87..8f762fa 100755 --- a/tools/mkcharinfo +++ b/tools/mkcharinfo @@ -2,7 +2,6 @@ use 5.014; use warnings; use utf8; -no if $] >= 5.018, warnings => 'experimental::smartmatch'; use lib '.'; use open OUT => ':encoding(utf-8)', ':std'; @@ -38,11 +37,15 @@ eval { 1; } or warn "Failed reading unicode tables: $@"; -eval { - my $kbd = do './keyboard/altgr/macos-abc.eng.inc.pl' or die $@ || $!; - $info{$_} //= {} for map {s/◌//g; m/\A./g} values %{ $kbd->{key} }; - 1; -} or warn "Failed reading additional keyboard map: $@"; +for my $layout ('macos-abc', 'windows') { + eval { + my $kbd = do "./keyboard/altgr/$layout.eng.inc.pl" or die $@ || $!; + my @def = map { values %{$_} } values %{ $kbd->{def} } + or die 'missing key definitions'; + $info{$_} //= {} for map {s/◌//g; m/\A./g} map { $_->[1] // () } @def; + 1; + } or warn "Failed reading additional keyboard map $layout: $@"; +} eval { require HTML::Entities;