简体   繁体   English

捕获android软键盘在webview的html页面的javascript中按下

[英]capturing android soft keypad presses in javascript of html page in webview

i am making a phonegap(v 1.3) android app. 我正在制作一个phonegap(v 1.3)android应用程序。 Bascically phonegap has a webview which loads an html page. 基本上,phonegap具有一个加载html页面的web视图。
I wanted to know if there was a way we can capture android soft keypad taps/clicks in javascript of that page , just like we could capture the key presses in javascript of the keyboard if the html page were on a normal desktop browser. 我想知道是否有一种方法可以捕获该页面javascript中的 android软键盘点击/单击,就像我们可以捕获html网页中的html脚本位于普通桌面浏览器中一样,可以捕获键盘javascript中的按键。 (using keypress event ). (使用keypress事件 )。
I actually wanted to attach an handler to the event when a particular key is tapped on the soft keypad (enter key). 我实际上想在软键盘上按特定键(输入键)时将事件处理程序附加到事件上。

Phonegap is not responsible for client side touch events. Phonegap不负责客户端触摸事件。 Its a bridge to give the client side additional functionality which the native application provides such as camera, accelerometer etc. If you are using jQuery mobile then have a look at the link. 它是为客户端提供本机应用程序提供的其他功能(例如相机,加速度计等)的桥梁。如果您使用的是jQuery mobile,请查看链接。

http://jquerymobile.com/test/docs/api/events.html http://jquerymobile.com/test/docs/api/events.html

  $("#myLink").bind('vclick',function(event){
        // do something
  });

   $("#myLink").bind('tap',function(event){
        // do other
  });

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

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