lua - 罗技鼠标重复切换
问题描述
我已经尝试过并且总是以无限循环结束。
我的代码:
toggle_button = 5
button_toggled = false
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == toggle_button then
button_toggled = not button_toggled
if button_toggled then
while button_toggled do
OutputLogMessage(tostring(button_toggled))
Sleep(50)
end
else
button_toggled = not button_toggled
end
end
end
解决方案
推荐阅读
- arangodb - 如何在 ArangoDB Foxx 测试中记录一些内容?
- oracle - 从针对 Oracle 数据库的 Entity Framework 6.X 迁移中删除模式
- sql - Oracle SQL - 从两个表映射属性
- angular - 每当我刷新 Ionic 应用程序时,我的值都会重置为零
- rest - 如何在 ActiveWeb 中支持网络资源
- javascript - 如何通过发布请求 api 在 ListView 上显示 json 数据
- javascript - 如何使用 RequireJS ?错误:“尚未为上下文加载模块名称“child_process”:使用 require([])”?
- php - 使用 PHP 删除不在我的 XML 文档中的文件
- html - 导航栏文本的中心,并右对齐。减小页面大小时也保持导航栏完整
- arrays - 具有通用元组元素的 Swift 元组数组