问题描述
我正在尝试制作一个可以输入内容的扩展程序,但由于某种原因,它不会输入减号。我曾尝试使用“char”和“keyDown”类型来输入它,但到目前为止没有任何效果。 这是我的代码
for (c of message.text.toString()) {
await wait(1000);
console.log(c);
if (c == '-') {
console.log('minus')
chrome.debugger.sendCommand(target,'Input.dispatchKeyEvent',{
type: 'rawKeyDown',code: 'Minus',key: '-',nativeVirtualKeyCode: 189,unmodifiedText: '-'
});
chrome.debugger.sendCommand(target,{
type: 'keyUp',unmodifiedText: '-'
});
} else {
chrome.debugger.sendCommand(target,{
type: 'char',text: c
});
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)