keyboard: split specific letters into altgr include
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 3 Dec 2023 15:00:57 +0000 (16:00 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 5 Dec 2023 03:41:22 +0000 (04:41 +0100)
Keep keyboard.eng.inc.pl for shared parsing of specified @rows characters.

altgr.eng.inc.pl [new file with mode: 0644]
keyboard.eng.inc.pl
keyboard.plp

diff --git a/altgr.eng.inc.pl b/altgr.eng.inc.pl
new file mode 100644 (file)
index 0000000..7c06938
--- /dev/null
@@ -0,0 +1,26 @@
+use utf8;
+my @usintrows = (
+       [  'a' ..                                            'z'],
+       [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
+       [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
+       [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
+       [qw(å ∫ ç ∂ ́ ƒ © ˙ ̂ ∆ ° ¬ µ ̃ ø π œ ® ß † ̈ √ ∑ ≈ ¥ Ω)],
+);
+our @rows = (
+       map {
+               my $c = $_;
+               [ map { $usintrows[$_]->[$c] } 0 .. 2 ]
+       } 0 .. $#{ $usintrows[0] }
+);
+
++{
+       %{ do 'keyboard.eng.inc.pl' },
+       title => 'altgr',
+       version => '1.2',
+       intro => 'Special <a href="/unicode">characters</a> returned with the AltGr modifier
+for the Windows US international layout.',
+       description => [
+               "Windows US international keyboard layout table",
+               "with the AltGr modifier key.",
+       ],
+}
index ff2d8e231635a3742348cd5b85302483c60745bd..0e6a8cbfb7ac3b9888d97b0717aa63f33406ef8f 100644 (file)
@@ -1,32 +1,8 @@
-use utf8;
 use Unicode::Normalize qw( NFKD );
 use Text::Unidecode qw( unidecode );
 
-my @usintrows = (
-       [  'a' ..                                            'z'],
-       [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
-       [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
-       [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
-       [qw(å ∫ ç ∂ ́ ƒ © ˙ ̂ ∆ ° ¬ µ ̃ ø π œ ® ß † ̈ √ ∑ ≈ ¥ Ω)],
-);
-my @usint = (
-       map {
-               my $c = $_;
-               [ map { $usintrows[$_]->[$c] } 0 .. 2 ]
-       } 0 .. $#{ $usintrows[0] }
-);
-
 {
-       title => 'keyboard',
-       version => '1.2',
-       description => [
-               "Windows US international keyboard layout table",
-               "with the AltGr modifier key.",
-       ],
-       intro => 'Special <a href="/unicode">characters</a> returned with the AltGr modifier
-for the Windows US international layout.',
        rows => [0],
-
        def => {
                '' => {
                        map {
@@ -40,13 +16,13 @@ for the Windows US international layout.',
                                        : 7
                                );
                                $row[0] => "g$class"
-                       } @usint
+                       } @rows
                },
        },
        key => {
                map {
                        $_->[0] => "$_->[1]<br>$_->[2]"
-               } @usint
+               } @rows
        },
        flag => {
                g1 => ['unaltered', "same results as without modifier"],
index 36ccaca07a113bbc7a76591f677a318ac525675f..c96977d7eb7dadf4df9f596dad50222322489a90 100644 (file)
@@ -1,6 +1,6 @@
 <(common.inc.plp)><:
 
-my $mode = lc($Request || 'keyboard');
+my $mode = lc($Request || 'altgr');
 my $include = "$mode.eng";
 
 my $info = eval { Data($include) } || {};