From f7debc650090d344b01da353f44a49dcf029303a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 3 Dec 2023 16:00:57 +0100 Subject: [PATCH] keyboard: split specific letters into altgr include Keep keyboard.eng.inc.pl for shared parsing of specified @rows characters. --- altgr.eng.inc.pl | 26 ++++++++++++++++++++++++++ keyboard.eng.inc.pl | 28 ++-------------------------- keyboard.plp | 2 +- 3 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 altgr.eng.inc.pl diff --git a/altgr.eng.inc.pl b/altgr.eng.inc.pl new file mode 100644 index 0000000..7c06938 --- /dev/null +++ b/altgr.eng.inc.pl @@ -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 characters returned with the AltGr modifier +for the Windows US international layout.', + description => [ + "Windows US international keyboard layout table", + "with the AltGr modifier key.", + ], +} diff --git a/keyboard.eng.inc.pl b/keyboard.eng.inc.pl index ff2d8e2..0e6a8cb 100644 --- a/keyboard.eng.inc.pl +++ b/keyboard.eng.inc.pl @@ -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 characters 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]
$_->[2]" - } @usint + } @rows }, flag => { g1 => ['unaltered', "same results as without modifier"], diff --git a/keyboard.plp b/keyboard.plp index 36ccaca..c96977d 100644 --- a/keyboard.plp +++ b/keyboard.plp @@ -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) } || {}; -- 2.30.0