delite/typematic

delite/typematic is used for two purposes:

Examples

Here's an example of implementing a repeating action when the user presses the arrow key while focused in a textbox, or clicks the plus icon next to the textbox:

require(["delite/keys", "delite/typematic"], function(keys, typematic){
     typematic.addKeyListener(textbox, {keyCode: keys.DOWN_ARROW}, null, function(){
          textbox.value = textbox.value - -1;    // + 1 causes string concat
     }, 500, 100, 10);
     typematic.addMouseListener(icon, null, function(){
          textbox.value = textbox.value - -1;    // + 1 causes string concat
     }, 500, 100, 10);
});

with html:

<input id="textbox" value="1"><span id="icon">+</span>