eef05efc8fcdadd23430e9ab680ddc8bf7f2c9ce
[sheet.git] / keyboard.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'keyboard cheat sheet',
5         version => '1.0',
6         stylesheet => [qw( light dark circus mono red )],
7         keys => 1,
8 });
9
10 :>
11 <h1>keyboard cheat sheet</h1>
12
13 <h2>normal mode (default)</h2>
14
15 <:
16 use Shiar_Sheet::Keyboard 2;
17 my $usint = [
18         [  'a' ..                                            'z'],
19         [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
20         [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
21         [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
22         [qw(å ∫ ç ∂ ´ ƒ © ˙ ^ ∆ ° ¬ µ ~ ø π œ ® ß † ¨ √ ∑ ≈ ¥ Ω)],
23 ];
24
25 my $keys = Shiar_Sheet::Keyboard->new({
26         def => {
27                 '' => {
28                         map { $_ => [''] } @{ $usint->[0] }
29                 },
30         },
31         key => {
32                 map {
33                         my $i = ord($_) - ord('a');
34                         $_ => ["$usint->[1]->[$i]<br>$usint->[2]->[$i]"]
35                 } 'a'..'z'
36         },
37 });
38 $keys->map($get{map}) or undef $get{map};
39 $keys->print_rows($get{rows}, [0]);
40 :>
41 <hr>
42
43 <div class="help">
44         <div class="right">
45                 <ul class="legend legend-set">
46                 <li>keyboard <strong>map</strong> is
47                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
48                 <li><strong>keys</strong> are
49                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
50                                 !exists $get{keys} && ' by default' :>
51                 <li>default <strong>style</strong> is
52                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
53                 </ul>
54         </div>
55 </div>
56