1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <title>Typematic Test</title>
6 <style type="text/css">
7 @import "../../../dojo/resources/dojo.css";
8 @import "../../themes/tundra/tundra.css";
9 @import "../css/dijitTests.css";
12 <script type="text/javascript" src="../../../dojo/dojo.js"
13 djConfig="isDebug: true, debugAtAllCosts: true"></script>
14 <script type="text/javascript">
15 dojo.require("dijit._base.typematic");
18 function typematicCallBack(count, node, evt){
19 var inputNode = dojo.byId('typematicInput');
20 if (node == inputNode){
26 console.debug((lastCount+1) + ' ' + key + ' events');
29 inputNode.value += key;
33 dojo.addOnLoad(function(){
34 var keyNode = dojo.byId('typematicInput');
35 var mouseNode = dojo.byId('typematicButton');
36 dijit.typematic.addKeyListener(keyNode,
38 keyCode:dojo.keys.F10,
41 this, typematicCallBack, 200, 200);
42 dijit.typematic.addMouseListener(mouseNode,
43 this, typematicCallBack, 0.9, 200);
44 keyNode.focus(); // make it easier to type
50 <h2>Dijit typematic tests</h2>
51 Press and hold the <b>ctrl+F10</b> keys to see a's typed (constant rate) in the input field,<br>
52 or left-mouse click the button and hold down to see b's typed (increasing rate) in the input field.<br>
53 <input id="typematicInput" size="500"><button id="typematicButton">to B or not to B</button>