Code cleanup.
use utf8;
use strict;
use warnings;
+do './keyboard/altgr/groups.inc.pl';
my %dyalogx = (
'Q' => '⍰',
'N' => '⍡',
'M' => '∥',
);
-our %rows = (
+my %rows = (
'~' => '⌺',
'!' => '⌶',
'@' => '⍫',
%dyalogx,
);
-my $groups = do 'keyboard/altgr/groups.inc.pl';
+my $groups = kbchars(\%rows);
$groups->{def}{''}{$_} = 'g4' for split //,'weEriIoOa/*'; # lookalikes
$groups->{def}{''}{$_} .= ' ext' for keys %dyalogx;
$groups->{flag}{ext} = ['extended', 'optional operators not available in all variants'];
use utf8;
use strict;
use warnings;
+do './keyboard/altgr/groups.inc.pl';
my $V = v1.3;
'+' => '⇔',
);
-our %rows = (
+my %rows = (
'1' => '¡',
'!' => '¹',
'2' => 'ª',
(map { ($presymbol.$_ => $arrows{$_}) } keys %arrows),
);
-my $groups = do 'keyboard/altgr/groups.inc.pl';
+my $groups = kbchars(\%rows);
$groups->{mode} = {
'' => 'option-shifted ⌥',
'm' => 'Ω greek prefix ⌥m',
-use strict;
+use 5.020;
use warnings;
+use experimental 'signatures';
use Unicode::Normalize qw( NFKD );
use Text::Unidecode qw( unidecode );
use Shiar_Sheet::FormatChar;
-our %rows;
-
my $uc = Shiar_Sheet::FormatChar->new;
-my %g; # present group classes
-{
+
+sub kbchars ($rows) {
+ my %g; # present group classes
+ return {
rows => [1, 0],
def => {
'' => {
map {
- my $v = $rows{$_};
+ my $v = $rows->{$_};
my $class = 'g'.(
!defined $v || $_ eq $v ? 1 # identical
: $v =~ /\A\p{Mn}+\z/ ? 9 # combining accent
);
$g{$class} = 1;
$_ => $class
- } keys %rows
+ } keys %{$rows}
},
},
key => {
map {
- my ($glyph, $title) = $uc->glyph_html($rows{$_});
+ my ($glyph, $title) = $uc->glyph_html($rows->{$_});
$_ => join "\n", $glyph, $title
- } keys %rows
+ } keys %{$rows}
},
flag => {%{{
g2 => ['accented', "decomposes to the original letter with a combining accent"],
g8 => ['mark', "modifier letter or mark (spacing diacritic)"],
g9 => ['combining', "diacritical mark to be combined with a following character"],
}}{keys %g}},
+ };
}
+
+1;
use utf8;
use strict;
use warnings;
-our %rows = (
+do './keyboard/altgr/groups.inc.pl';
+
+my %rows = (
'A' => "\N{MACRON}",
'a' => "\N{COMBINING MACRON}",
'B' => "\N{BREVE}",
'>b' => 'ɓ',
);
-my $groups = do './keyboard/altgr/groups.inc.pl';
+my $groups = kbchars(\%rows);
$groups->{mode} = {
'' => 'option-shifted ⌥',
':' => '№ number prefix ⌥:',
use utf8;
use strict;
use warnings;
-our %rows = (
+do './keyboard/altgr/groups.inc.pl';
+
+my %rows = (
'A' => 'Å',
'a' => 'å',
'B' => 'ı',
);
+{
- %{ do 'keyboard/altgr/groups.inc.pl' },
+ %{ kbchars(\%rows) },
version => '1.3',
title => 'US option',
intro => join("\n",
use utf8;
use strict;
use warnings;
-our %rows = (
+do './keyboard/altgr/groups.inc.pl';
+
+my %rows = (
'!' => '¡',
'1' => 'ƒ',
'@' => '₧',
);
+{
- %{ do 'keyboard/altgr/groups.inc.pl' },
+ %{ kbchars(\%rows) },
version => '1.0',
title => 'msx code',
intro => join("\n",
use utf8;
use strict;
use warnings;
-our %rows = (
+do './keyboard/altgr/groups.inc.pl';
+
+my %rows = (
'q' => '∧',
'w' => '∨',
'e' => '∩',
);
+{
- %{ do 'keyboard/altgr/groups.inc.pl' },
+ %{ kbchars(\%rows) },
version => '1.0',
title => 'Space Cadet',
intro => join("\n",
use utf8;
use strict;
use warnings;
-our %rows = (
+do './keyboard/altgr/groups.inc.pl';
+
+my %rows = (
'~' => '¦',
'!' => '¡',
'1' => '¹',
$rows{']'} = $rows{'#'};
+{
- %{ do 'keyboard/altgr/groups.inc.pl' },
+ %{ kbchars(\%rows) },
title => 'UK-extended',
version => '1.0',
intro => join("\n",
use utf8;
use strict;
use warnings;
+do './keyboard/altgr/groups.inc.pl';
my @az = ('A'..'Z', 'a'..'z');
my @letters = qw(
'?' => "\N{COMBINING HOOK ABOVE}",
);
-our %rows = (
+my %rows = (
'~' => "\N{COMBINING TILDE}",
'`' => "\N{COMBINING GRAVE ACCENT}",
'!' => '¹',
} 0 .. $#az
);
-my $groups = do './keyboard/altgr/groups.inc.pl';
+my $groups = kbchars(\%rows);
$groups->{def}{''}{$_} .= ' ext' for keys %xkb;
$groups->{flag}{ext} = ['xkb', 'unofficial extensions added in Linux (Gnome, KDE)'];