以下脚本实现了默认的 G1~G6 输出数字 1~6。
flag = 0
--ClearLog()
--[[
function getScanCode()
OutputLogMessage("Call Function.\n")
PressAndReleaseMouseButton(1)
end
]]--
function OnEvent(event, arg)
--getScanCode()
if (flag > 10) then
ClearLog()
flag = 0
else
flag = flag + 1
end
if (event == "G_PRESSED") then
OutputLogMessage("G%d-Key was pressed. Event time: %s!\n", arg, GetDate())
PressKey(1 + arg)
end
if (event == "G_RELEASED") then
OutputLogMessage("G%d-Key was released. Event time: %s!\n", arg, GetDate())
ReleaseKey(1 + arg)
end
end
flag = 0
--ClearLog()
--[[
function getScanCode()
OutputLogMessage("Call Function.\n")
PressAndReleaseMouseButton(1)
end
]]--
function OnEvent(event, arg)
--getScanCode()
if (flag > 10) then
ClearLog()
flag = 0
else
flag = flag + 1
end
if (event == "G_PRESSED") then
OutputLogMessage("G%d-Key was pressed. Event time: %s!\n", arg, GetDate())
PressKey(1 + arg)
end
if (event == "G_RELEASED") then
OutputLogMessage("G%d-Key was released. Event time: %s!\n", arg, GetDate())
ReleaseKey(1 + arg)
end
end




