javascript - How to create an on-screen keyboard which will show which keys are being typed currently? - Stack Overflow

I've got an online typing program and I want to create an on-screen keyboard for them, rather like

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
Add a ment  | 

2 Answers 2

Reset to default 5

Try 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...

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745254873a4618895.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信