<: # included from keyboard.plp use 5.014; use warnings; use utf8; my $dirbase = 'keyboard/altgr'; my $indexfile = "$dirbase/index"; Html({ title => "altgr keyboard cheat sheets", version => '1.3', description => [ "Overview of alternate keyboard modes,", "offering extended Unicode characters if a modifier key", "(such as AltGr or option) is pressed.", ], keywords => [qw' sheet cheat reference overview keyboard altgr option '], image => "$dirbase/thumb/ibm-m.jpg", stylesheet => [qw( light dark circus mono red )], data => ["$dirbase/index.inc.plp", "$indexfile.inc.pl"], raw => <<'.', . }); :>

Extended keyboards

Overview of available key layouts with AltGr or similar modifier keys. Also see digraphs for compose key combinations.

<: my $idx = Data($indexfile); my @incs; push @incs, @{ $idx->{$_} } for @{ $idx->{default} }; my @sample = split /(?VERSION(3.00); use List::Util qw( uniq max sum ); my %caticon = ( legacy => qq{\N{TOP HAT}}, windows => qq{\x{1FA9F}}, # \N{WINDOW} macos => qq{\N{RED APPLE}}, xorg => qq{\N{PENGUIN}}, ); printf '
', @sample ? 'section' : 'gallery'; if (@sample) { print ''; print ''; } my $most = max( map { sum values %{$_} } map { $_->{inventory}{''} } @{$idx}{@incs} ); for my $inc (@incs) { my $table = $idx->{$inc}; print @sample ? ''; } } print '
'; print "$_" for @sample; say '
' : '
'; printf '', "$dirbase/$inc"; my $title = $table->{title} || $inc; unless (@sample) { if (my $img = $table->{image}) { EscapeHTML $name = $table->{imagealt} // $img =~ m{.*/([^/.]*)}; print qq{$name}; } printf '
%s
', $title; say '
'; } else { print $title; print '', "\n\t"; for my $mode ($table->{mode} ? sort keys %{ $table->{mode} } : '') { print ''; printf "", m/^(\S*)/ for $mode && $table->{mode}{$mode} || (); for my $g (sort keys %{ $table->{inventory}{$mode} }) { printf ' %s', $g, $_/$most*100, $_, join(' ', map { $table->{flag}{$_}[0] || 'extra' # legend label of each class } reverse split / /, $g) for $table->{inventory}{$mode}{$g}; } say ''; } print "\t
"; print join ' ', map { $caticon{$_} // () } split m{/}, $table->{category} // ''; say ''; if (my $keys = eval { my $keydata = Data("$dirbase/$inc.eng"); Shiar_Sheet::Keyboard->new($keydata) }) { for my $c (@sample) { my $def = $keys->{def}{''}{$c} // []; $def->[0] //= 'ni'; $def->[0] =~ s/ mode\S*//; $keys->print_key('', $c, $def); } } say '
' if @sample; :>