看板 EzHotKey 關於我們 聯絡資訊
自己修改了一下,現在按 1 會跳出訊息視窗 b q p ...... 不過,有一個Bug,執行腳本後, 什麼鍵都還沒按,就會馬上跳出一個訊息視窗,為什麼? ;調用函式庫,下載網址與用法請見 ;http://www.autohotkey.com/forum/topic14881.html #Include AHKA.ahk ;創造兩個陣列 AHKA_SetDebug(false) arrBoPoMo := "[1,q,a,z,2,w,s,x,e,d,c,r,f,v]" arrPinyin := "[b,p,m,f,d,t,n,l,g,k,h,j,q,x]" AHKA_SetDebug(true) length := AHKA_Size(arrBoPoMo) index := 0 ;改變鍵盤對應 SendKey(Pinyin) { MsgBox, %Pinyin% ; Send %Pinyin% } Loop, %length% { index = %A_Index% BoPoMo := AHKA_Get(arrBoPoMo, index) HotKey %BoPoMo%, Hoty } Return ;為什麼必須要這個Return Hoty: index := AHKA_Find(arrBoPoMo,A_ThisHotkey) Pinyin := AHKA_Get(arrPinyin, index) SendKey(Pinyin) Return -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 58.114.192.127 ※ 編輯: shyangs 來自: 58.114.192.127 (04/17 17:07)
arj32:在Hoty:上面加一行return 04/17 20:30
arj32:你寫的非常漂亮 我之前沒想到用A_ThisHotkey 04/17 20:43
謝謝,問題解決了。 但為何必須要加 Return ,我的 Loop 有限定次數了啊 ※ 編輯: shyangs 來自: 58.114.192.127 (04/17 21:19)
arj32:他執行到了最后一行,因為lable不會讓他停下來 04/17 21:28
arj32:你去看一下help的the Auto-execute Section 04/17 21:32