Skip to content

Commit

Permalink
Add dispatch sample
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Apr 25, 2017
1 parent ecbee16 commit ce23320
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions keyboard/dispatch.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<input type="number" value="0">
<script>
setInterval(function() {
document.querySelector('input').focus();
document.querySelector('input').dispatchEvent(new KeyboardEvent('keypress', {
key: 'ArrowUp',
bubbles: true,
cancelable: false
}));
}, 1000);
</script>

0 comments on commit ce23320

Please sign in to comment.