admin管理员组文章数量:1416651
I've got an online typing program and I want to create an on-screen keyboard for them, rather like how they do it in typing programs, such as Keyblaze Typing Tutor. So is there a way to create a JavaScript program which will display the keys (the presentation aesthetics don't matter) which are currently being typed by the user?
I've got an online typing program and I want to create an on-screen keyboard for them, rather like how they do it in typing programs, such as Keyblaze Typing Tutor. So is there a way to create a JavaScript program which will display the keys (the presentation aesthetics don't matter) which are currently being typed by the user?
Share Improve this question edited Dec 29, 2015 at 2:05 Zerium asked Apr 6, 2012 at 10:11 ZeriumZerium 17.4k32 gold badges118 silver badges187 bronze badges 1- I've been looking online for things like jQuery on Screen Keyboard and similar plugins, but they only allow you to enter text into a textbox, they don't show anything when text is typed using the actual keyboard on your puter. – Zerium Commented Apr 6, 2012 at 10:15
2 Answers
Reset to default 5Try extending this example
jQuery:
$(function () {
$("#input").keydown(function (event) {
$("#" + String.fromCharCode(event.which)).addClass("trigger");
}).keyup(function (event) {
$("#" + String.fromCharCode(event.which)).removeClass("trigger");
});
});
You can create a keyboard using pure HTML and CSS. See this beautiful example
You can find nice jQuery on Screen Keyboard Plugin on this site. Read the documentation too.
It looks like this...
本文标签:
版权声明:本文标题:javascript - How to create an on-screen keyboard which will show which keys are being typed currently? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745254873a2650040.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论