简体   繁体   English

iOS5移动Safari:使用语音助手处理HTML输入文本键盘上/下键?

[英]iOS5 Mobile Safari: Handle HTML Input Text keyup/keydown with Voice Assistant?

I've got an html form text field that normally handles key up/down events. 我有一个html表单文本字段,该文本字段通常可以处理按键向上/向下事件。 However, just noticed that if you use the mic assistant in ios5 mobile safari to fill the field for you, the key up/down isn't getting triggered. 但是,请注意,如果您在ios5移动浏览器中使用麦克风助手为您填写字段,则不会触发向上/向下键。

Anyone know what event should be bound to instead to handle? 有人知道应该绑定什么事件来处理吗? Currently using jQuery w/o jQuery Mobile (file size restrictions) - plain JS would be super too. 当前使用不带jQuery Mobile的jQuery(文件大小限制)-纯JS也将是超级。 Am hoping I don't need to resort to polling. 希望我不需要诉诸投票。

Fiddle of demo code: http://jsfiddle.net/jfroom/wAdC8/5/ 演示代码小提琴: http : //jsfiddle.net/jfroom/wAdC8/5/

You can get to the mic functionality by clicking on the little mic icon on the text input tray. 您可以通过单击文本输入托盘上的小麦克风图标来获得麦克风功能。

Thanks in advance. 提前致谢。

Solution in jquery below. 下面的jQuery解决方案。 (I'm sure there's a pure JS equivalent very similar to this.) (我敢肯定有一个与此非常相似的纯JS等效项。)

$("#myinput").bind("input paste", handleChange);

Demo here: http://jsfiddle.net/jfroom/JLQLV/31/ 演示在这里: http : //jsfiddle.net/jfroom/JLQLV/31/

.bind("input propertychange") also works, but can dilute other key up/down events. .bind(“ input propertychange”)也可以,但是可以稀释其他按键向上/向下事件。 Thanks to SLaks for this find Jquery / JS bind "paste" event handler to input textbox 感谢SLaks的帮助 ,此Jquery / JS将“粘贴”事件处理程序绑定到输入文本框

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM