keyboard/altgr: olpc layout from xorg us symbols
[sheet.git] / keyboard / altgr / olpc.eng.inc.pl
1 use utf8;
2 use strict;
3 use warnings;
4 use Shiar_Sheet::KeyboardChars 'kbchars';
5
6 my %rows = (
7         '1' => '¡',
8         '2' => '¬',
9         '3' => "\N{COMBINING GRAVE ACCENT}",
10         '4' => "\N{COMBINING ACUTE ACCENT}",
11         '5' => "\N{COMBINING BREVE}",
12         '6' => "\N{COMBINING RING ABOVE}",
13         '7' => "\N{COMBINING CIRCUMFLEX ACCENT}",
14         '8' => "\N{COMBINING CARON}",
15         '9' => "\N{COMBINING DOT ABOVE}",
16         '0' => "\N{COMBINING DIAERESIS}",
17         '-' => "\N{COMBINING MACRON}",
18         '=' => "\N{COMBINING TILDE}",
19
20         'q' => 'ω',
21         'Q' => 'Ω',
22         'w' => 'ø',
23         'W' => 'Ø',
24         'e' => 'œ',
25         'E' => 'Œ',
26         'r' => "\N{COMBINING CEDILLA}",
27         't' => "\N{COMBINING BREVE BELOW}",
28         'y' => "\N{COMBINING RING BELOW}",
29         'u' => "\N{COMBINING CIRCUMFLEX ACCENT BELOW}",
30         'i' => "\N{COMBINING CARON BELOW}",
31         'o' => "\N{COMBINING DOT BELOW}",
32         'p' => "\N{COMBINING DIAERESIS BELOW}",
33         '[' => "\N{COMBINING MACRON BELOW}",
34         ']' => "\N{COMBINING TILDE BELOW}",
35
36         'a' => 'æ',
37         'A' => 'Æ',
38         's' => 'ß',
39         'S' => 'ẞ',
40         'd' => 'ð',
41         'D' => 'Ð',
42         'f' => 'þ',
43         'F' => 'Þ',
44         'h' => '£',
45         'j' => '€',
46         ';' => 'º',
47         ':' => 'ª',
48         "'" => '¤',
49         '\\'=> '§',
50
51         'c' => 'ç',
52         'C' => 'Ç',
53         'n' => 'ñ',
54         'N' => 'Ñ',
55         'm' => "\N{MICRO SIGN}",
56         ',' => '«',
57         '.' => '»',
58         '/' => '¿',
59 );
60
61 my %shift = (
62         qw[ ! 1  @ 2  # 3  $ 4  % 5  ^ 6  & 7  * 8  ( 9  ) 0  _ -  + = ],
63         qw( { [  } ]  " '  | \  < ,  > .  ? /  ` 3  ~ = ),
64         (map {uc, lc} qw[ r t y u i o p  h j  m  ]),
65 );
66
67 my $groups = kbchars(\%rows);
68 $groups->{flag}{ext} = ['alias', 'identical results from unshifted key'];
69 while (my ($alias, $target) = each %shift) {
70         # copy alias to shifted
71         $groups->{key}{$alias} = $groups->{key}{$target};
72         $groups->{def}{''}{$alias} = $groups->{def}{''}{$target}.' ext';
73 }
74 $groups->{def}{''}{$_} =~ s/g7/g4/ for qw( ! < > ? ); # similar punctuation
75
76 +{
77         %{ $groups },
78         version => '1.0',
79         title => 'OLPC',
80         category => 'legacy/latin',
81         intro => join("\n",
82                 "International US English developed for the OLPC project,",
83                 'providing mostly European',
84                 '<a href="/unicode">Unicode</a> characters while pressing AltGr,',
85                 'entirely different from the <a href="/keyboard/altgr/windows">Windows</a>',
86                 'or <a href="/keyboard/altgr/macos">MacOS</a> maps.',
87         ),
88         description => [
89                 "OLPC keyboard layout table",
90                 "with the AltGr modifier key:",
91                 "provides common western European letters and symbols,",
92                 "and various combining accents above and below.",
93         ],
94         image => 'data/keyboard/thumb/olpc.jpg',
95         imagealt => 'AltGr on the OLPC XO Laptop',
96         moderows => '21-1',
97 }