Virtual Keyboard Playground
https://github.com/Mottie/Keyboard
by Mottie
HTML
<link rel="stylesheet" href="https://mottie.github.io/Keyboard/css/keyboard.css">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css">
<script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.js"></script>
<script src="https://mottie.github.io/Keyboard/js/jquery.mousewheel.js"></script>
<script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.extension-typing.js"></script>
<div id="wrap">
<input id="keyboard" type="text" />
<img id="icon" src="https://mottie.github.io/Keyboard/docs/css/images/keyboard.png" />
</div>
<script>
/* Code to get jQuery UI to work with jQuery 3.4+ ... */
$.isArray = function(a) {
return Object.prototype.toString.call(a) === '[object Array]';
}
$.isFunction = function(f) {
return typeof f === 'function';
}
$.isWindow = function(w) {
var toString = Object.prototype.toString.call(w);
return toString == '[object global]' ||
toString == '[object Window]' ||
toString == '[object DOMWindow]';
}
</script>
<script src="https://mottie.github.io/Keyboard/docs/js/jquery-ui-custom.min.js"></script>
CSS
body {
margin-top: 100px;
}
#wrap {
display: block;
margin: 0 auto;
width: 200px;
}
JavaScript
/* VIRTUAL KEYBOARD DEMO - https://github.com/Mottie/Keyboard */
$(function() {
$('#keyboard').keyboard({
layout: 'num',
// Event (namepaced) for when the character is added to the
// input (clicking on the keyboard)
keyBinding: 'mouseenter',
})
// activate the typing extension
.addTyping({
showTyping: true,
delay: 250
});
});