找回密码
 加入
搜索
查看: 2375|回复: 1

[GUI管理] 可不可以设置鼠标快捷键?

[复制链接]
发表于 2015-6-23 08:39:52 | 显示全部楼层 |阅读模式
就是可不可以向HotKeySet函数一样,设置鼠标的某一键或组合键调用某个函数。谢谢!
发表于 2015-7-3 22:45:01 | 显示全部楼层
HotKeySet
设置一个可调用某用户函数的热键.
HotKeySet ( "热键" [, "函数名"] )

UDF函数
_IsPressed
检查一个按键是否被按下
#include <Misc.au3>
_IsPressed($sHexKey [, $vDLL = 'user32.dll'])

示例/演示
#include <Misc.au3>

Local $hDLL = DllOpen("user32.dll")

While 1
    If _IsPressed("02", $hDLL) Then
        ConsoleWrite("_IsPressed - 鼠标右键 was pressed." & @CRLF)
        ; 一直等待,直到按键被释放
        While _IsPressed("04", $hDLL)
            Sleep(250)
        WEnd
        ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF)
    ElseIf _IsPressed("01", $hDLL) Then
        MsgBox(4096, "_IsPressed", "The 鼠标左键 was pressed, therefore we will close the application.")
        ExitLoop
    EndIf
    Sleep(250)
WEnd

DllClose($hDLL)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-4 05:05 , Processed in 0.073000 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表