是否可以强行打开虚拟键盘? [英] Is it possible to open virtual keyboard forcefully?

查看:82
本文介绍了是否可以强行打开虚拟键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从服务器接收到某些命令时,是否可以弹出虚拟键盘?我正在尝试将注意力集中在文本区域上,但是软键盘并没有出现.我同意要弹出键盘,需要用户事件.有什么方法可以强制显示虚拟键盘吗?我说的是Android chrome浏览器中的网络应用.

Is it possible to popup virtual keyboard when some command is being received from server? I am trying to call focus on text area but soft keyboard is not coming. I agree that for keyboard to popup, user event is required. Is there any way to show virtual keyboard forcefully? I am talking about web app inside Android chrome browser.

推荐答案

您可以通过在输入中调用 focus()然后 click()来实现此目的,但是,如您所说,仅当脚本由用户输入启动时.经过一整天的摆弄,我目前的答案是没有办法解决这个问题.

You can do this by calling focus() then click() on the input, but, as you say, only when the script is initiated by user input. My current answer, having spent a day fiddling, is that there is no way to get around this.

这篇关于是否可以强行打开虚拟键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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