问题描述
我正在尝试修改我在网上找到的一些 HTML。我想让它当用户按下一个键(numpad2/keycode 98)时,它会按下“添加时间”按钮,就像用户用鼠标按下它一样。
是否可以输入一段代码来使击键就像鼠标点击按钮一样?
这是 addTime 函数
function addTime()
{
clearTimeout(pendingUpdate)
var amount = +document.getElementById('add-mins').value * 60
amount += +document.getElementById('add-secs').value
amount *= 1000
var now = new Date()
now = now.getTime()
if (showNegative || target > now)
{
target += amount
timeLeft += amount
}
else
{
target = now + amount
timeLeft = amount
}
if (paused)
display()
else
update()
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)