【问题标题】:Autoit HotKeySet bugAutoit HotKeySet 错误
【发布时间】:2021-01-21 06:35:57
【问题描述】:

我有这个代码:

If $choixListAction == "ACTION1" Then
   HotKeySet("{ENTER}", "_getPos")
EndIf

Func _getPos()
        
    Global $posSouris = MouseGetPos()
    
    $posX = MouseGetPos(0) 
    $posY = MouseGetPos(1)
    
    Return $posX & ":" & $posY
EndFunc 

我按 ENTER 但任何操作都有效。

【问题讨论】:

  • 这不是完整的代码,对吧? $choixListAction 定义在哪里?

标签: automation autoit


【解决方案1】:

也许您的脚本不再运行以处理热键。以下代码适用于我:

HotKeySet("{ENTER}", "_MyFunc")
While True
    Sleep(150)
WEnd

Func _MyFunc()
    MsgBox(0, "MyFunc", "Hello :)")
EndFunc   ;==>_MyFunc

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多