Java脚本和虚拟键盘的jsp [英] Java script and jsp for virtual keyboard

查看:97
本文介绍了Java脚本和虚拟键盘的jsp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在jsp页面上为虚拟键盘运行javascript ????

How to run javascript on jsp page for virtual keyboard?????

推荐答案

这里是一种临时方法,我假设在具有触摸屏但未连接键盘的设备上查看页面:
Here is an ad hoc approach in which I''m assuming that the page is being viewed on a device that has a touchscreen but no keyboard attached:

  1. HTML中的每个文本框都必须具有onfocus事件的事件处理程序.
  2. 您必须包括div或其他合适的容器,该容器具有构成虚拟键盘的控件(按钮等).
  3. 通常会隐藏以前的键盘容器
  4. 在收到onfocus事件后,您将记住当前处于活动状态的文本框并开始使用键盘显示容器
  5. 键盘按钮还具有事件处理程序,这些事件处理程序会在按下某个虚拟键时进行注册
  6. 在文本框中执行相应的操作,该操作由我们的代码在步骤4中存储.
  7. 额外的好处:还存储内容在进行编辑之前,您可以在虚拟键盘上使用一个撤消按钮,以防您弄乱了编辑.

  1. Every textbox in you html must have an event handler for the onfocus event.
  2. You must include a div or some other suitable container which has the controls (buttons etc) that make up your virtual keyboard.
  3. Former keyboard container is usually hidden
  4. Upon receiving the onfocus event you memorize which textbox is currently active and start showing the container with the keyboard
  5. The keyboard buttons also have event handlers which register when a certain virtual key was pressed
  6. Execute the appropriate actions on the textbox which was memorized by our code in step 4
  7. Extra bonus: also memorize the content prior to editing so you can have an undo button on your virtual keyboard in case you messed up your editing.


首先,如果遇到问题,请回来并提出更具体的要求!

最好的问候,

-MRB


Start with this and if you run into problems come back and ask more specifically!

Best Regards,

-MRB


这篇关于Java脚本和虚拟键盘的jsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆