仅长按单键执行功能,不影响短按示例

许多实用脚本和封装函数, 可以让您编写脚本更加便捷高效
nuance
Posts: 7
Joined: 23 Jan 2015, 21:01

仅长按单键执行功能,不影响短按示例

23 Jan 2015, 21:54

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

tmplinshi
Posts: 1092
Joined: 01 Oct 2013, 14:57

Re: 仅长按单键执行功能,不影响短按示例

24 Jan 2015, 09:42

这样简单点

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

$t::
KeyWait, t
If (A_TimeSinceThisHotkey > 300)
SetTimer, mainp, -1
Else
SendInput, % GetKeyState("CapsLock", "T") ? "T" : "t"
Return

mainp:
Run, http://www.baidu.com
Return
nuance
Posts: 7
Joined: 23 Jan 2015, 21:01

Re: 仅长按单键执行功能,不影响短按示例

24 Jan 2015, 22:27

tmplinshi wrote:这样简单点

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

$t::
KeyWait, t
If (A_TimeSinceThisHotkey > 300)
SetTimer, mainp, -1
Else
SendInput, % GetKeyState("CapsLock", "T") ? "T" : "t"
Return

mainp:
Run, http://www.baidu.com
Return

哈,太棒了,原来还有keywait这个功能 :bravo:
我居然都没发现,到处找方法怎么实现。
keywait更省CPU啊。
cixiplc
Posts: 8
Joined: 18 Oct 2014, 15:52

Re: 仅长按单键执行功能,不影响短按示例

03 Apr 2015, 05:30

keywait 以后还是有点区别,因为原来是按键一触即发 keywait就得等释放按键后才运行
Tom2016
Posts: 1
Joined: 23 Apr 2016, 03:52

Re: 仅长按单键执行功能,不影响短按示例

23 Apr 2016, 04:06

It is not working correctly, i found it will has issue when you press w and a, the "aw" will come out

$w::
KeyWait, w
If (A_TimeSinceThisHotkey > 500)
SetTimer, mainpw, -1
Else
SendInput, % GetKeyState("CapsLock", "W") ? "W" : "w"
Return
mainpw:
msgbox, w
Return

Return to “脚本函数”

Who is online

Users browsing this forum: No registered users and 2 guests