digits: chinese counting rods
[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 terse'],
7         keys => 1,
8 });
9
10 :>
11 <h1>keyboard cheat sheet</h1>
12
13 <h2>normal mode (default)</h2>
14
15 <ul id="rows">
16
17 <li class="row">
18         <ul class="keys omni">
19         <li class="mo chr27" onclick="setmode()"><b>Esc</b> normal mode
20                 <!-- not as static anymore, but never bothered; just see ^[ -->
21         </ul>
22 </li>
23
24 <:
25 our %sign;
26 use Shiar_Sheet::Keyboard 2;
27 my $usint = [
28         [  'a' ..                                            'z'],
29         [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
30         [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
31         [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
32         [qw(å ∫ ç ∂ ´ ƒ © ˙ ^ ∆ ° ¬ µ ~ ø π œ ® ß † ¨ √ ∑ ≈ ¥ Ω)],
33 ];
34
35 my $keys = Shiar_Sheet::Keyboard->new({
36         def => {
37                 '' => {
38                         map { $_ => [''] } @{ $usint->[0] }
39                 },
40         },
41         key => {
42                 map {
43                         my $i = ord($_) - ord('a');
44                         $_ => ["$usint->[1]->[$i]<br>$usint->[2]->[$i]"]
45                 } 'a'..'z'
46         },
47 });
48 $keys->map($get{map}) or undef $get{map};
49 $keys->print_rows($get{rows}, [0]);
50 :>
51 </ul>
52
53 <hr>
54
55 <div class="help">
56         <div class="left">
57                 <dl class="legend legend-types">
58                 <dt class="ci">info
59                         <dd>Info command: shows/does something without altering anything.
60                 <dt class="pm">motion
61                 <dt class="po">positioning
62                         <dd>Other movement (jumps, window (re)positioning).
63                 <dt class="co">command
64                         <dd>Direct action command.
65                 <dt class="mi">ins mode
66                         <dd>Enters Insert or Replace mode.
67                 <dt class="mo">mode
68                         <dd>Enters a different mode.
69                 <dt class="mv">vis mode
70                         <dd>Enters Visual or Select mode.
71                 <dt class="me">key cmd
72                         <dd>Additional key commands (click for overview).
73                 </dl>
74         </div>
75
76         <div class="right">
77                 <dl class="legend legend-options">
78                 </dl>
79
80                 <ul class="legend legend-set">
81                 <li>keyboard <strong>map</strong> is
82                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
83                 <li><strong>keys</strong> are
84                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
85                                 !exists $get{keys} && ' by default' :>
86                 <li>default <strong>style</strong> is
87                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
88                 </ul>
89         </div>
90 </div>
91