Re: [AHK-] 請問如何簡化if&else

看板EzHotKey作者 (咚!)時間15年前 (2008/12/24 02:07), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《b19111010 (怡君怎麼會輸的…)》之銘言: : 1.老問題,如何在scroll燈亮著的時候按一下其他鍵即成觸發條件? : 這樣就無需採取一直按著某鍵+某鍵的熱鍵模式。 1.這個問題可以這樣解 直接讓ScrollLock成為全部熱鍵的開關 也就是Suspend的應用 然後是判斷按鍵狀態的GetKeyState 以下是Code: (1)把這段加在Code最前面 Suspend,on GetKeyState, state,ScrollLock,t if state = D { Suspend,off }else { Suspend,on } ~ScrollLock:: Suspend, Permit GetKeyState, state,ScrollLock,t if state = D { Suspend,off }else { Suspend,on } return (2)再修改熱鍵為單鍵且按下時失去原本作用 例: #A:: → $A:: 就可以了 2.用自訂函數取代部份Code: send ^{space}5027.97^{space} DateChange(2009/1/19) ifwinexist Microsoft Internet Explorer { send {enter} DateChange(2009/1/20) ifwinexist Microsoft Internet Explorer { send {enter} DateChange(2009/1/21) ifwinexist Microsoft Internet Explorer { send {enter} DateChange(2009/1/22) ifwinexist Microsoft Internet Explorer { DateChange(2009/1/23) click,257,203 } else click,333,359 } else click,333,359 } else click,333,359 DateChange(D){ click,596,291 send ^{space}{ctrl down}{a}{ctrl up}^{space} send %D% click,257,203 sleep,3000 } 以上! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.200.149.78

12/29 19:11, , 1F
感謝大大!!!!!我研究看看~~
12/29 19:11, 1F
文章代碼(AID): #19KIZY4w (EzHotKey)
文章代碼(AID): #19KIZY4w (EzHotKey)