找回密码
 加入
搜索
查看: 1865|回复: 3

[AU3基础] 模拟键盘判断键值是否长按

[复制链接]
发表于 2011-3-6 02:15:31 | 显示全部楼层 |阅读模式
大家好。是不是_ISPRESSED 函数用错了么?只能开启长按ALT键再次按的时候关闭不了..
另外程序结束后好像ALT键还是一直被长按的,请问这怎么解决?
谢谢了
#include <GUIConstants.au3>
#include <Misc.au3>

$dll = DllOpen("user32.dll")

GUICreate("魔兽显血",200,100)
GUICtrlCreateLabel("Home Button",10,40,50)
GUISetState(@SW_SHOW)
HotKeySet("{Home}","Open_Fun")

Func Open_Fun()
        If _IsPressed("12,$dll") Then 
                Send("{ALT up}")
                MsgBox(0,"Button is released!","Button is released!")
        Else
                Send("{ALT down}")
                MsgBox(0,"Button is pressed!","Button is pressed!")
                EndIf
        EndFunc

While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
                WEnd
发表于 2011-3-6 02:48:09 | 显示全部楼层
dllclose呢,帮助里不是写的很明白吗
发表于 2011-3-7 22:41:03 | 显示全部楼层
你打魔兽,一直按着alt,如果点左键的话,好像别人会很不爽的..
 楼主| 发表于 2011-3-10 17:21:00 | 显示全部楼层
谢谢2楼的朋友.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-21 12:44 , Processed in 0.091878 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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