keyboard/altgr: olpc layout from xorg us symbols
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 25 Jan 2024 22:30:48 +0000 (23:30 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 Jan 2024 17:17:48 +0000 (18:17 +0100)
Sufficiently complete latin alternative found in xkb presets but as
described "a little different from the usual international layout".

Representative image with sufficient detail from:
https://commons.wikimedia.org/wiki/File:Fossdem_2009_olpc_001.jpg

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

diff --git a/keyboard/altgr/olpc.eng.inc.pl b/keyboard/altgr/olpc.eng.inc.pl
new file mode 100644 (file)
index 0000000..3884b9a
--- /dev/null
@@ -0,0 +1,97 @@
+use utf8;
+use strict;
+use warnings;
+use Shiar_Sheet::KeyboardChars 'kbchars';
+
+my %rows = (
+       '1' => '¡',
+       '2' => '¬',
+       '3' => "\N{COMBINING GRAVE ACCENT}",
+       '4' => "\N{COMBINING ACUTE ACCENT}",
+       '5' => "\N{COMBINING BREVE}",
+       '6' => "\N{COMBINING RING ABOVE}",
+       '7' => "\N{COMBINING CIRCUMFLEX ACCENT}",
+       '8' => "\N{COMBINING CARON}",
+       '9' => "\N{COMBINING DOT ABOVE}",
+       '0' => "\N{COMBINING DIAERESIS}",
+       '-' => "\N{COMBINING MACRON}",
+       '=' => "\N{COMBINING TILDE}",
+
+       'q' => 'ω',
+       'Q' => 'Ω',
+       'w' => 'ø',
+       'W' => 'Ø',
+       'e' => 'œ',
+       'E' => 'Œ',
+       'r' => "\N{COMBINING CEDILLA}",
+       't' => "\N{COMBINING BREVE BELOW}",
+       'y' => "\N{COMBINING RING BELOW}",
+       'u' => "\N{COMBINING CIRCUMFLEX ACCENT BELOW}",
+       'i' => "\N{COMBINING CARON BELOW}",
+       'o' => "\N{COMBINING DOT BELOW}",
+       'p' => "\N{COMBINING DIAERESIS BELOW}",
+       '[' => "\N{COMBINING MACRON BELOW}",
+       ']' => "\N{COMBINING TILDE BELOW}",
+
+       'a' => 'æ',
+       'A' => 'Æ',
+       's' => 'ß',
+       'S' => 'ẞ',
+       'd' => 'ð',
+       'D' => 'Ð',
+       'f' => 'þ',
+       'F' => 'Þ',
+       'h' => '£',
+       'j' => '€',
+       ';' => 'º',
+       ':' => 'ª',
+       "'" => '¤',
+       '\\'=> '§',
+
+       'c' => 'ç',
+       'C' => 'Ç',
+       'n' => 'ñ',
+       'N' => 'Ñ',
+       'm' => "\N{MICRO SIGN}",
+       ',' => '«',
+       '.' => '»',
+       '/' => '¿',
+);
+
+my %shift = (
+       qw[ ! 1  @ 2  # 3  $ 4  % 5  ^ 6  & 7  * 8  ( 9  ) 0  _ -  + = ],
+       qw( { [  } ]  " '  | \  < ,  > .  ? /  ` 3  ~ = ),
+       (map {uc, lc} qw[ r t y u i o p  h j  m  ]),
+);
+
+my $groups = kbchars(\%rows);
+$groups->{flag}{ext} = ['alias', 'identical results from unshifted key'];
+while (my ($alias, $target) = each %shift) {
+       # copy alias to shifted
+       $groups->{key}{$alias} = $groups->{key}{$target};
+       $groups->{def}{''}{$alias} = $groups->{def}{''}{$target}.' ext';
+}
+$groups->{def}{''}{$_} =~ s/g7/g4/ for qw( ! < > ? ); # similar punctuation
+
++{
+       %{ $groups },
+       version => '1.0',
+       title => 'OLPC',
+       category => 'legacy/latin',
+       intro => join("\n",
+               "International US English developed for the OLPC project,",
+               'providing mostly European',
+               '<a href="/unicode">Unicode</a> characters while pressing AltGr,',
+               'entirely different from the <a href="/keyboard/altgr/windows">Windows</a>',
+               'or <a href="/keyboard/altgr/macos">MacOS</a> maps.',
+       ),
+       description => [
+               "OLPC keyboard layout table",
+               "with the AltGr modifier key:",
+               "provides common western European letters and symbols,",
+               "and various combining accents above and below.",
+       ],
+       image => 'data/keyboard/thumb/olpc.jpg',
+       imagealt => 'AltGr on the OLPC XO Laptop',
+       moderows => '21-1',
+}