1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>Signal Example
</title>
6 <link href=
"key_events.css" rel=
"stylesheet" type=
"text/css" />
7 <script type=
"text/javascript" src=
"../../MochiKit/MochiKit.js"></script>
8 <script type=
"text/javascript" src=
"key_events.js"></script>
13 Key Events with MochiKit
16 This is an example of one might implement a key listener with
17 MochiKit
’s Signal.
20 For a detailed description of what happens under the hood, check out
21 <a href=
"key_events.js" class=
"view-source">key_events.js
</a>.
26 <a href=
"index.html" class=
"view-source">index.html
</a> |
27 <a href=
"key_events.js" class=
"view-source">key_events.js
</a> |
28 <a href=
"key_events.css" class=
"view-source">key_events.css
</a>
32 <p>Check this box to test
<a href=
"http://mochikit.com/doc/html/MochiKit/Signal.html#fn-preventdefault">
33 preventDefault()
</a> in your browser:
34 <input type=
"checkbox" id=
"stopBox" /></p>
36 <p id=
"specialMessage">This text is replaced with a message when you press Escape or F1.
</p>
46 <td id=
"onkeydown_code">-
</td>
47 <td id=
"onkeydown_string">-
</td>
51 <td id=
"onkeyup_code">-
</td>
52 <td id=
"onkeyup_string">-
</td>
56 <td id=
"onkeypress_code">-
</td>
57 <td id=
"onkeypress_string">-
</td>
67 <th>Meta (Command)
</th>