[AHK-] 熱鍵送出問題。這樣寫錯在哪?

看板EzHotKey作者 (丹丹)時間15年前 (2010/04/15 20:26), 編輯推噓0(004)
留言4則, 1人參與, 最新討論串1/2 (看更多)
我預期 按1送出b 按q送出p 按a送出m (暫時三個,以後會增加) 但失敗了,請幫我看下程式碼,謝謝。 ;調用函式庫,下載網址與用法請見 ;http://www.autohotkey.com/forum/topic14881.html #Include AHKA.ahk ;創造兩個陣列 AHKA_SetDebug(false) arrBoPoMo := "[1,q,a]" arrPinyin := "[b,p,m]" AHKA_SetDebug(true) ;改變鍵盤對應 SendKey(BoPoMo, Pinyin) { ;紅字部份是我想要,但是失敗的程式碼 /* Hotkey, %BoPoMo%, Pinyin Pinyin: Send %Pinyin% Return */ MsgBox, %BoPoMo% } index = 1 Loop, 3 { BoPoMo := AHKA_Get(arrBoPoMo, index) ;取得陣列項目值 Pinyin := AHKA_Get(arrPinyin, index) SendKey(BoPoMo, Pinyin) index := index + 1 } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 58.114.192.127

04/15 22:40, , 1F
你的Pinyin:放在function里面無效
04/15 22:40, 1F
為什麼放在函式裡無效?有哪些指令不可以放在函式裡? 要怎麼改@@a ※ 編輯: shyangs 來自: 58.114.192.127 (04/15 22:56)

04/15 23:37, , 2F
一個函式被call過后就銷毀了(覺得這句怪怪的= =?),于是你的
04/15 23:37, 2F

04/15 23:39, , 3F
hotkey指向的label為空
04/15 23:39, 3F

04/15 23:41, , 4F
...按你的思路,我做不出來,等高手.
04/15 23:41, 4F
文章代碼(AID): #1BnmOD1g (EzHotKey)
文章代碼(AID): #1BnmOD1g (EzHotKey)