代码打开输入法的手写功能

1.先下载搜狗输入法手写输入插件,

2.创建txt文件,内容为:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Webshell]
@="URL:Webshell Protocol Handler"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Webshell\DefaultIcon]
@="D:\\SogouInput\\Components\\HandInput\\1.1.0.322\\handinput.exe"
[HKEY_CLASSES_ROOT\Webshell\shell]
[HKEY_CLASSES_ROOT\Webshell\shell\open]
[HKEY_CLASSES_ROOT\Webshell\shell\open\command]
@="\"D:\\SogouInput\\Components\\HandInput\\1.1.0.322\\handinput.exe\" \"%1\""

注:这是我的handinput.exe本地路径,修改为自己的电脑下的路径

3.txt后缀改为reg,并运行

4. 使用a标签触发事件 

<a href="Webshell://test">testhandinput</a>

5.关闭手写板

function f() {

       let cmd=new ActiveXObject("WScript.Shell");

       cmd.run("taskkill /f /t /im handinput.exe",0);

   }

6.如果打不开,请查看ie浏览器设置:

Internet选项 ——》安全——》自定义级别——》标记为安全执行脚本activex控件初始化并执行脚本——》启用

 

 

 

posted @ 2019-11-29 19:16  迪丽热巴掌上明珠  阅读(400)  评论(0编辑  收藏  举报