1 <: # included from keyboard.plp
5 my @incs = glob 'keyboard/altgr/*.eng.inc.pl';
8 title => "altgr keyboard cheat sheets",
11 "Overview of alternate keyboard modes,",
12 "offering extended Unicode characters if a modifier key",
13 "(such as AltGr or option) is pressed.",
16 sheet cheat reference overview keyboard altgr option
18 image => 'data/keyboard/thumb/ibm-m.jpg',
19 stylesheet => [qw( light dark circus mono red )],
20 data => ['keyboard/altgr/index.inc.plp', @incs],
24 display: inline-table; /* centered */
27 border-collapse: separate;
29 border-spacing: .4vw; /* inline td margin equivalent */
35 display: table-row-group;
42 position: static; /* under sticky thead */
52 vertical-align: middle;
59 <h1>Extended keyboards</h1>
61 <p>Overview of available key layouts with AltGr or similar modifier keys.</p>
64 my @sample = split /(?<!\+)/, $get{sample} // 'asSci1!+1';
65 require Shiar_Sheet::Keyboard;
67 printf '<section class="%s">', @sample ? 'section' : 'gallery';
69 print '<table class="big keys cmp">';
70 print '<thead><tr><th>';
71 print "<th>$_" for @sample;
74 my %idx = map {s/\Q.inc.pl\E$//; ($_ => eval{ Data($_) })} @incs;
76 $idx{$a}{category} cmp $idx{$b}{category} || $a cmp $b
78 print @sample ? '<tr><th>' : '<figure>';
79 printf '<a href="/%s">', $inc =~ s/\.eng$//r;
80 my $table = $idx{$inc};
81 my $title = $table && $table->{title} || $inc;
84 if ($table and my $img = $table->{image}) {
85 EscapeHTML $name = $table->{imagealt} // $img =~ m{.*/([^/.]*)};
86 print qq{<img src="/$img" alt="$name" />};
88 printf '<figcaption>%s</figcaption>', $title;
94 my $keys = Shiar_Sheet::Keyboard->new($table);
95 print '<br>', join(' ', map { $keys->{key}{$_} =~ s/\s.*//r } grep {$_} keys %{$_})
96 for $keys->{mode} || ();
97 $keys->print_key('', $_, $keys->{def}{''}{$_} // 'ni') for @sample;
101 print '</table>' if @sample;