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

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

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

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTWebshell]
@="URL:Webshell Protocol Handler"
"URL Protocol"=""
[HKEY_CLASSES_ROOTWebshellDefaultIcon]
@="D:\SogouInput\Components\HandInput\1.1.0.322\handinput.exe"
[HKEY_CLASSES_ROOTWebshellshell]
[HKEY_CLASSES_ROOTWebshellshellopen]
[HKEY_CLASSES_ROOTWebshellshellopencommand]
@=""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控件初始化并执行脚本——》启用

原文地址:https://www.cnblogs.com/szqtiger/p/11959723.html