588aedc6cf8f3ea644de7459ab217fa83f911bda
[sheet.git] / keyboard.plp
1 <(common.inc.plp)><:
2         our $VERSION = 'v1.0';
3
4         use Shiar_Sheet::KeySigns qw(%sign);
5
6 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
7  "http://www.w3.org/TR/html4/loose.dtd">
8 <html>
9
10 <head>
11 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
12 <title>keyboard cheat sheet</title>
13 <:= stylesheet(qw'light dark circus mono red terse') :>
14 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
15 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
16         our $showkeys = exists $get{keys} && $get{keys} ne '0';
17         print "\n".'<style type="text/css"> .no {visibility:hidden} </style>'
18                 unless $showkeys;
19         print "\n".'<style type="text/css"> .no, .alias {opacity:.5} </style>'
20                 if $showkeys and $get{keys} eq 'ghost';
21 :>
22 <script type="text/javascript" src="/keys.js"></script>
23
24 <body id="keyboard">
25
26 <h1>keyboard cheat sheet</h1>
27
28 <h2>normal mode (default)</h2>
29
30 <ul id="rows">
31
32 <li class="row">
33         <ul class="keys omni">
34         <li class="mo chr27" onclick="setmode()"><b>Esc</b> normal mode
35                 <!-- not as static anymore, but never bothered; just see ^[ -->
36         </ul>
37 </li>
38
39 <:
40 our %sign;
41 use Shiar_Sheet::Keyboard;
42 my $usint = [
43         [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
44         [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
45         [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
46         [qw(å ∫ ç ∂ ´ ƒ © ˙ ^ ∆ ° ¬ µ ~ ø π œ ® ß † ¨ √ ∑ ≈ ¥ Ω)],
47 ];
48
49 my $keys = Shiar_Sheet::Keyboard->new({
50         '' => {
51                 map {
52                         my $i = ord($_) - ord('a');
53                         $_ => ["$usint->[0]->[$i]<br>$usint->[1]->[$i]"]
54                 } 'a'..'z'
55         }
56 });
57 $keys->map($get{map}) or undef $get{map};
58 $keys->print_rows($get{rows}, [0]);
59 :>
60 </ul>
61
62 <hr>
63
64 <div class="help">
65         <div class="left">
66                 <dl class="legend legend-types">
67                 <dt class="ci">info
68                         <dd>Info command: shows/does something without altering anything.
69                 <dt class="pm">motion
70                 <dt class="po">positioning
71                         <dd>Other movement (jumps, window (re)positioning).
72                 <dt class="co">command
73                         <dd>Direct action command.
74                 <dt class="mi">ins mode
75                         <dd>Enters Insert or Replace mode.
76                 <dt class="mo">mode
77                         <dd>Enters a different mode.
78                 <dt class="mv">vis mode
79                         <dd>Enters Visual or Select mode.
80                 <dt class="me">key cmd
81                         <dd>Additional key commands (click for overview).
82                 </dl>
83         </div>
84
85         <div class="right">
86                 <dl class="legend legend-options">
87                 </dl>
88
89                 <ul class="legend legend-set">
90                 <li>keyboard <strong>map</strong> is
91                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
92                 <li><strong>ascii</strong> mode is
93                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
94                                 $sign{-ascii} ? 'on' : 'off' :></em>
95                 <li><strong>keys</strong> are
96                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
97                                 !exists $get{keys} && ' by default' :>
98                 <li>default <strong>style</strong> is
99                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
100                 </ul>
101         </div>
102 </div>
103
104 <p class="footer">
105         <a href="/" rel="home">sheet.shiar.nl</a>/vim.<a href="/source/vim.plp"
106          rel="code" title="Written in Perl">plp</a>
107         <a href="http://git.shiar.nl/sheet.git/history/HEAD:/vim.plp"
108          rel="vcs-git" title="Git repository"><:= $VERSION :></a>
109         created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
110         <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
111          title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
112 </p>
113
114 </html>