
#if srf_mode&&!GetKeyState("CapsLock", "T")&&not srf_all_input~="\d+"
;{{{ a-z定义
	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::
	srf_all_input .= A_ThisHotkey, waitnum:=select_sym:=0,num_for_select_arrays:=[], num__:=""
	gosub srf_tooltip_fanye
return

#if srf_mode&&!GetKeyState("CapsLock", "T")&&not srf_all_input~="\d+"&&srf_all_input~="^``"
	`::
	srf_all_input .= A_ThisHotkey, waitnum:=select_sym:=0,num_for_select_arrays:=[], num__:="",citiao_arr:=[]
	gosub srf_tooltip_fanye
return
#if

#if srf_mode&&!GetKeyState("CapsLock", "T")&&not srf_all_input~="\d+"&&srf_all_input~="^``[a-z]+"
	1::
		StrLen(srf_for_select_Array[1,1])>1?srf_select(1):Select_add(1)
	return
	2::Select_add(2)
	3::Select_add(3)
	4::Select_add(4)
	5::Select_add(5)
	6::Select_add(6)
	7::Select_add(7)
	8::Select_add(8)
	9::Select_add(9)
	0::Select_add(10)
	space::srf_select(1)
#if 

#If srf_mode&&InStr(srf_all_Input,"/")&&not srf_all_input ~="[a-z]"
	1::
	2::
	3::
	4::
	5::
	6::
	7::
	8::
	9::
	0::
	Numpad1::
	Numpad2::
	Numpad3::
	Numpad4::
	Numpad5::
	Numpad6::
	Numpad7::
	Numpad8::
	Numpad9::
	Numpad0::
	.::
	NumpadDot::
	srf_all_input .= A_ThisHotkey, select_sym:=0
	gosub srf_tooltip_fanye
Return
#If

#if srf_mode&&!srf_all_input
	Numpad1::
	1::
		send {1}
		num__:=A_ThisHotkey
	Return
	Numpad2::
	2::
		send {2}
		num__:=A_ThisHotkey
	Return
	Numpad3::
	3::
		send {3}
		num__:=A_ThisHotkey
	Return
	Numpad4::
	4::
		send {4}
		num__:=A_ThisHotkey
	Return
	Numpad5::
	5::
		send {5}
		num__:=A_ThisHotkey
	Return
	Numpad6::
	6::
		send {6}
		num__:=A_ThisHotkey
	Return
	Numpad7::
	7::
		send {7}
		num__:=A_ThisHotkey
	Return
	Numpad8::
	8::
		send {8}
		num__:=A_ThisHotkey
	Return
	Numpad9::
	9::
		send {9}
		num__:=A_ThisHotkey
	Return
	Numpad0::
	0::
		send {0}
		num__:=A_ThisHotkey
	Return

	;快速多行注释
	^/::
		ClipSaved:=ClipboardAll
		Clipboard:=""
		send ^x
		send {/}{*}{`n 2}{*}{/}{up}
		send ^v
		Clipboard:=ClipSaved, ClipSaved:=""
	Return
	'::send % srf_symblos["'",symb_mode]
	`;::send % srf_symblos[";",symb_mode]
	,::send % srf_symblos[",",symb_mode]
	\::send % srf_symblos["\",symb_mode]
	[::send % srf_symblos["[",symb_mode]
	]::send % srf_symblos["]",symb_mode]
	=::send % srf_symblos["=",symb_mode]
	+,::send % srf_symblos["<",symb_mode]
	+.::send % srf_symblos[">",symb_mode]
	+/::send % srf_symblos["?",symb_mode]
	^+w::run,http://98wb.ys168.com/   ;ctrl+Shift+w
	^q::run, config\码元图.jpg    ;cltr+q键打开码元
	+1::send % srf_symblos["!",symb_mode]
	+2::send % srf_symblos["@",symb_mode]
	+4::send % srf_symblos["$",symb_mode]
	+5::send % srf_symblos["%",symb_mode]
	+6::send % srf_symblos["^",symb_mode]
	+7::send % srf_symblos["&",symb_mode]
	+8::send % srf_symblos["*",symb_mode]
	+9::send % srf_symblos["(",symb_mode]
	+0::send % srf_symblos[")",symb_mode]
	+;::send % srf_symblos[":",symb_mode]
	+'::send % srf_symblos["""",symb_mode]

	.::
		if num__~="\d"
			send {.}
		else
			send % srf_symblos[".",symb_mode]
		num__:=""
	Return
	CapsLock::
		GetKeyState, CL_State, CapsLock, T
		if CL_State ~="U"{
			SetCapsLockState , on
			Menu, Tray, Icon, config\wubi98.icl,21,1
			GuiControl,3:, Pics,*Icon17 config\wubi98.icl
			gosub Get_IME
		}
		else
		{
			SetCapsLockState , off
			Menu, Tray, Icon, config\wubi98.icl,9,1
			GuiControl,3:, Pics,*Icon1 config\wubi98.icl
			gosub Get_IME
		}
		select_sym:=0,srf_input:=[]
	Return
	`::
		srf_all_Input .= A_ThisHotkey, select_sym:=0
		;[ ` ]引导常用符号自定义，Sym_Array多维数组首位置空，其它按顺序排列，增加的话 直接在数组里添加格式 >>  ,["符号"]
		global Sym_Array :=[[""],["·"],["～"],["☯"],["•"],["℃"],["‰"],["℉"],["％"],["※"],["●"],["○"],["★"],["☆"],["©"],["ㄓ"]]
		gosub srf_tooltip_fanye
	Return
	/::
		srf_all_Input .= A_ThisHotkey, select_sym:=0
		;[ / ]引导常用符号自定义，Sym_Array多维数组首位置空，其它按顺序排列，增加的话 直接在数组里添加格式 >>  ,["符号"]
		global Sym_Array_1 :=[[""],["？"],["、"]]
		gosub srf_tooltip_fanye
	Return
	~::
		srf_all_Input .= A_ThisHotkey, select_sym:=0
		gosub srf_tooltip_fanye 
	Return
return
#if

#if !srf_mode&&!srf_all_input
	+'::send {"}{"}{left}

	;快速多行注释
	^/::
		ClipSaved:=ClipboardAll
		Clipboard:=""
		send ^x
		send {/}{*}{`n 2}{*}{/}{up}
		send ^v
		Clipboard:=ClipSaved, ClipSaved:=""
	Return

	CapsLock::
		GetKeyState, CL_State, CapsLock, T
		if CL_State ~="D"{
			SetCapsLockState , off
			Menu, Tray, Icon, config\wubi98.icl,12,1
			GuiControl,3:, Pics,*Icon19 config\wubi98.icl
			gosub Get_IME
		}
		else
		{
			SetCapsLockState , on
			Menu, Tray, Icon, config\wubi98.icl,21,1
			GuiControl,3:, Pics,*Icon17 config\wubi98.icl
			gosub Get_IME
		}
		select_sym:=0,srf_input:=[]
	Return
return
#if

#If srf_all_input&&srf_all_input~="\d+"
	space::
	`;::
	'::
	a::
	s::
	d::
	f::
	g::
	h::
	j::
	k::
	l::
	m::
	if InStr(Select_Code,A_ThisHotkey)>10
	{
		if A_ThisHotkey~="`;"
			srf_select(2)
		if A_ThisHotkey~="'"
			srf_select(3)
		if A_ThisHotkey~="i)space"
			srf_select(1)
	}else
		srf_select(InStr(Select_Code,A_ThisHotkey))
	Return

#If

#if srf_all_input&&not srf_all_input~="\d+"

;快速选词快捷键
	Space::
	1::
		srf_select(1)
	Return
	`;::
	2::
		srf_select(2)
	Return
	'::
	3::
		srf_select(3)
	Return
	4::srf_select(4)
	5::srf_select(5)
	6::srf_select(6)
	7::srf_select(7)
	8::srf_select(8)
	9::srf_select(9)
	0::srf_select(10)

;快速删词快捷键「Ctrl+Alt+{1-0}」
	^!1::
	^!Numpad1::
		Delete_Word(1)
	return

	^!2::
	^!Numpad2::
		Delete_Word(2)
	return

	^!3::
	^!Numpad3::
		Delete_Word(3)
	return

	^!4::
	^!Numpad4::
		Delete_Word(4)
	return

	^!5::
	^!Numpad5::
		Delete_Word(5)
	return

	^!6::
	^!Numpad6::
		Delete_Word(6)
	return

	^!7::
	^!Numpad7::
		Delete_Word(7)
	return

	^!8::
	^!Numpad8::
		Delete_Word(8)
	return

	^!9::
	^!Numpad9::
		Delete_Word(9)
	return

	^!0::
	^!Numpad0::
		Delete_Word(10)
	return

;快速置顶「Ctrl+{1-0}」
	^1::
	^Numpad1::
		set_top(1),srf_select(1)
	return

	^2::
	^Numpad2::
		set_top(2),srf_select(2)
	return

	^3::
	^Numpad3::
		set_top(3),srf_select(3)
	return

	^4::
	^Numpad4::
		set_top(4),srf_select(4)
	return

	^5::
	^Numpad5::
		set_top(5),srf_select(5)
	return

	^6::
	^Numpad6::
		set_top(6),srf_select(6)
	return

	^7::
	^Numpad7::
		set_top(7),srf_select(7)
	return

	^8::
	^Numpad8::
		set_top(8),srf_select(8)
	return

	^9::
	^Numpad9::
		set_top(9),srf_select(9)
	return

	^0::
	^Numpad0::
		set_top(10),srf_select(10)
	return
#If

#if srf_all_input
	CapsLock::
		GetKeyState, CL_State, CapsLock, T
		if CL_State ~="U"{
			;sendinput % StringUpper(srf_all_input)    ;去掉行首分号启用按下CapsLock上屏大写英文
			Gosub srf_value_off
			srf_for_select_Array :=[]
			SetCapsLockState , on
			Menu, Tray, Icon, config\wubi98.icl,21,1
			GuiControl,3:, Pics,*Icon17 config\wubi98.icl
			gosub Get_IME
		}
		else
			GuiControl,3:, Pics,*Icon1 config\wubi98.icl
		srf_for_select_Array :=select_arr:=srf_input:=[],Select_result:="",count_ci:=1,select_sym:=0
	Return
	[::
	-::
		Gosub lessWait
	Return
	]::
	=::
		Gosub MoreWait
	Return
	Esc::
		Gosub srf_value_off
		srf_for_select_Array :=select_arr:=[],Select_result:="",count_ci:=1, select_sym:=0
	Return
	BackSpace::
		if (RegExReplace(srf_all_input,"^``")~="\``"&&srf_input[count_ci-1]= RegExReplace(srf_all_input,".+\``")&&count_ci>2){
			Select_result:=RegExReplace(Select_result,select_value[count_ci]),select_arr[1]:=RegExReplace(select_arr[1],select_value[count_ci])
			count_ci:=(count_ci>1)?(count_ci-1):1
		}
		srf_all_Input:=SubStr(RegExReplace(srf_all_Input,"'",""), 1, -1), select_sym:=waitnum:=0
		If StrLen(srf_all_Input)<1
		{
			Gosub srf_value_off
			srf_for_select_Array :=select_arr:=srf_input:=[],Select_result:="",count_ci:=1
		}Else{
			Gosub srf_tooltip_fanye
		}
	Return

	Enter::
	NumpadEnter::
		if Select_Enter~="send"
		{
			sendinput % RegExReplace(srf_all_input,"\'","")
			Gosub srf_value_off
			srf_for_select_Array :=select_arr:=srf_input:=[],Select_result:="",count_ci:=1
		}
		else
		{
			Gosub srf_value_off
			srf_for_select_Array :=select_arr:=[],Select_result:="",count_ci:=1
		}
		select_sym:=0
	Return
#if

#if srf_mode&&srf_all_input&&srf_for_select_Array.Length()>0&&symb_send ~="on"
{
	+1::
		srf_select(1)
		send {！}
	Return
	+2::
		srf_select(1)
		send {@}
	Return
	+3::
		srf_select(1)
		send {#}
	Return
	+4::
		srf_select(1)
		send {$}
	Return

	+5::
		srf_select(1)
		send {`%}
	Return

	+6::
		srf_select(1)
		send {…}{…}
	Return
	+7::
		srf_select(1)
		send {&}
	Return
	+8::
		srf_select(1)
		send {*}
	Return
	+9::
		srf_select(1)
		send {（}
	Return
	+0::
		srf_select(1)
		send {）}
	Return
	+-::
		srf_select(1)
		send {—}{—}
	Return
	++::
		srf_select(1)
		send {+}
	Return
	+[::
		srf_select(1)
		send {「}
	Return
	+]::
		srf_select(1)
		send {」}
	Return
	+`;::
		srf_select(1)
		send {：}
	Return
	+'::
		srf_select(1)
		send {“}{”}{left}
	Return
	+,::
		srf_select(1)
		send {《}
	Return
	+.::
		srf_select(1)
		send {》}
	Return
	+/::
		srf_select(1)
		send {？}
	Return
	,::
		srf_select(1)
		send {，}
	Return
	.::
		srf_select(1)
		send {。}
	Return
	/::
		srf_select(1)
		send {、}
	Return
	[::
		srf_select(1)
		send {「}
	Return
	]::
		srf_select(1)
		send {」}
	Return
	+\::
		srf_select(1)
		send {·}
	Return
	\::
		srf_select(1)
		send {、}
	Return
/*
	`::
		srf_select(1)
		send {-}{-}{-}{>}
	Return
*/
}
#if

;{{{ 脚本修改自动reload
#if WinActive("ahk_class i)Notepad") or WinActive("ahk_class i)EmEditor*") or WinActive("ahk_class i)Notepad*") or WinActive("ahk_class i)Chrome_WidgetWin*")
	~^s::
		WinGetTitle, title4, ahk_class i)Chrome_WidgetWin*
		WinGetTitle, title1, ahk_class i)EmEditor*
		WinGetTitle, title2, ahk_class i)Notepad*
		WinGetTitle, title3, ahk_class i)Notepad
		if (title1~="i)\.ahk"||title2~="i)\.ahk"||title3~="i)\.ahk"||title4~="i)\.ahk")
			Gosub OnReload
	return
#If
;}}}

/*
;************两组挂起快捷键已注释，去掉多行注释符即可启用*********************

^>RAlt::
	Suspend
	if A_IsSuspended =1
		Traytip,  提示:,已切换至挂起状态！
	else if A_IsSuspended =0
		Traytip,  提示:,已切换至启用状态！
return

!>RCtrl::
	Suspend
	if A_IsSuspended =1
		Traytip,  提示:,已切换至挂起状态！
	else if A_IsSuspended =0
		Traytip,  提示:,已切换至启用状态！
return

*/


!q::
	send ^c
	sleep 100
	select_for_code = %clipboard%
	select_for_code :=RegExReplace(select_for_code, "\d+|[a-zA-Z]{1,}|\s+|`n", "")
	select_for_code_result := Tip_rvlk(select_for_code)
	if (a_FontList ~="五笔拆字字根字体|98WB-V|98WB-P0|98WB-1|98WB-3|98WB-ZG|98WB-0"&&FontType ~="五笔拆字字根字体|98WB-V|98WB-P0|98WB-1|98WB-3|98WB-ZG|98WB-0")          ;判断是否安装「折分显示的字体」没安装的话只显示编码
	{
		srf_for_select_for_tooltip := select_for_code_result
		Caret:=GetCaretPos(), hasCaretPos:=1
		ToolTip(1, "", "Q1 B" BgColor " T" FontColor_Code " S" FontSize " F" FontType)
		ToolTip(1, srf_for_select_for_tooltip, "x" Caret.x " y" Caret.y+Caret.h)
	}
	else          ;判断是否安装「折分显示的字体」没安装的话只显示编码
	{
		Loop, Parse, select_for_code_result, `n
		{
			select_for_code_result_1 :=RegExReplace(A_LoopField, "〔.+\〕|^`n", "")
			srf_for_select_for_tooltip .=select_for_code_result_1 . "`n"
		}
		Caret:=GetCaretPos(), hasCaretPos:=1
		ToolTip(1, "", "Q1 B" BgColor " T" FontColor_Code " S" FontSize " F" FontType)
		ToolTip(1, srf_for_select_for_tooltip, "x" Caret.x " y" Caret.y+Caret.h)
		srf_for_select_for_tooltip :=
	}
	SetTimer, RemoveToolTip, 3200
	clipboard = 
return

^esc::
	Gosub OnExit
return

^CapsLock::
if WinExist("造词窗口"){
	Traytip,  警告提示:,不能重复打开「快捷造词」窗口！,,2
	Return
}
else
{
	if Wubi_Schema~="ci"
		gosub Add_Code
	else
		Traytip,,造词仅在98含词方案有效！
}
return

/*
~LButton::
	If (A_Cursor ~= "i)IBeam" ){
		global tip_pos:={x:A_CaretX,y:A_CaretY+30}
		gosub Get_IME
		Gui, tips: Destroy
		gosub Get_IME
	}
Return
*/

vk5d::return ; 屏蔽键盘上的菜单右键
