#Include Class_SQLiteDB.ahk
;-------------------------------打开数据库
DBFileName := A_ScriptDir . "\fenyin-xy.DB"
db:=sqlitedb()
sleep(1000)
If !DB.OpenDB(DBFileName)
{
MsgBox("Msg:`t" . DB.ErrorMsg . "`nCode:`t" . DB.ErrorCode, "SQLite Error", 16)
exitapp
}
;-------------------------------初始化变量/数组
global zi:=[]
global bianma:=[]
global changyong:=[]
global zhongwen :="1"
global result:=""
global ma:=""
global shengmu:= array2D(30,30)
global yunmu:= array2D(30,30)
global yinjie:= array2D(30,30)
loop 30
{
i:=a_index
loop 30
{
shengmu[i,a_index]:=""
yunmu[i,a_index]:=""
yinjie[i,a_index]:=""
}
}
;-------------------------------按shift切换中英文
shift::
{
global zhongwen:=!zhongwen
if(zhongwen)
{
trayseticon("中.ico")
}
else{
trayseticon("英.ico")
}
}
trayseticon("中.ico")
#hotif zhongwen
;--------------------------------------------------处理输入字母
a::
b::
c::
d::
e::
f::
g::
h::
i::
j::
k::
l::
m::
n::
o::
p::
q::
r::
s::
t::
u::
v::
w::
x::
y::
z::
{
global result:=""
global neirong:=""
global ma:=ma . a_thishotkey
global zi:=[]
global zishu:=0
zit:=[]
cit:=[]
zit:=souzi(ma)
Loop zit.Length
{
zishu:=A_Index
if (zishu>9)
break
neirong:= neirong . " " . zishu . "." . zit[zishu]
zi.Push(zit[zishu])
}
if strlen(ma)>1
{
cit:=souci(ma)
if (cit.length>0)
neirong:= neirong . "`n"
Loop cit.Length
{
if (A_Index+zishu>9)
break
neirong:= neirong . " " . A_Index+zishu . "." . cit[A_Index]
zi.Push(cit[A_Index])
}
}
xianshi(ma . "`n" . StrReplace(neirong,"-",""))
if (zi.Length=1)
{
shuchu:=zi[1]
if (instr(shuchu,"-")>0)
shuchu:=substr(shuchu,1,instr(shuchu,"-")-1)
send(shuchu)
ma:=""
tooltip()
neirong:=""
}
}
;--------------------------------------------------按空格
space::
1::
2::
3::
4::
5::
6::
7::
8::
9::
{
global xuan:= a_thishotkey
global ma
if ( zi.length>0)
{
if (xuan="space"){
xuan:="1"
}
if (xuan <= zi.length)
{
shuchu:=zi[xuan]
if (instr(shuchu,"-")>0)
shuchu:=substr(shuchu,1,instr(shuchu,"-")-1)
send(shuchu)
ma:=""
tooltip()
neirong:=""
global zi:=[]
}
}
else
{
if (a_thishotkey="space"){
key:=" "
}
else{
key:=a_thishotkey
}<