You will get the intensity
of keystroke in real time.
- Laptop with build-in microphone
- Google Chrome
It regards the volume from microphone as intencity of keystroke.
http://o.l0o0l.co (In the page, please allow to use your microphone)
<script src="/path/to/jquery.js"></script>
<script src="/path/to/keystroke_intensity.js"></script>
<script type="text/javascript">
// the simplest example
$(window).keystroke_intensity() // => console.log `keystroke info`
// you can use in your web app
$('input').keystroke_intensity = {
keytouch: function(e, volume) {
// you can add some codes here
console.log(String.fromCharCode(e.keyCode))
console.log('volume:', volume)
// and some functions
},
deleteKeyDown: function(e, volume){
// you also do something here
console.log('Delete key is pressed')
console.log('volume:', volume)
}
}
</script>