【问题标题】:How control the mouse and keyboard cursor in LuaLua中如何控制鼠标和键盘光标
【发布时间】:2021-11-11 23:12:17
【问题描述】:

Lua中如何控制鼠标光标

将鼠标光标移动到某个位置并点击它,通过图像处理确定位置

输入是:按钮的图片 该按钮上的输出操作

【问题讨论】:

  • 如果您说出您已经尝试过的内容、结果是什么以及您期望会发生什么,将会有所帮助。

标签: keyboard mouse


【解决方案1】:

你可以使用LuaJITAutoGUI

--Mouse
x, y = autogui.position()
autogui.moveTo(x, y, time)
autogui.moveBy(dx, dy, time)
autogui.mouseDown(button)
autogui.mouseUp(button)
autogui.scroll(amount)
autogui.click(x, y, button, clicks, interval)
autogui.doubleClick(x, y)
autogui.dragTo(x, y, button, time)
autogui.dragBy(dx, dy, button, time)
--Keyboard
autogui.keyDown(key)
autogui.keyUp(key)
autogui.press(key)
autogui.write(str, interval)
autogui.hotkey(...)
--MessageBox
autogui.alert(text, title)
autogui.confirm(text, title) -- returns 'OK' or 'Cancel'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-29
    • 2014-06-26
    • 1970-01-01
    • 2012-05-09
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    相关资源
    最近更新 更多