by AAHKUser » 07 Jul 2020, 03:39
大家好,因为在PS和AI中很多快捷键都是单个按键的, 所以需要关闭中文输入法,但有时又需要输入中文,基本每次用久了都会发生在按快捷键的时候,却打开了输入框的情况,很让人恼火。我打算通过A_Cursor来获取鼠标状态,使只有在要输入文字的时候才打开中文输入法,在其他情况下都保持英文输入法。我写的代码如下:
Code: Select all
GroupAdd, DesignerGroup, ahk_class illustrator ;把需要这个功能的软件编组
GroupAdd, DesignerGroup, ahk_class Photoshop
GroupAdd, DesignerGroup, ahk_class GHOST_WindowClass
#IfWinActive, ahk_group DesignerGroup
; #IfWinActive, ("ahk_class Photoshop") or WinActive("ahk_class illustrator") or WinActive("ahk_class GHOST_WindowClass")
~LButton::
If (A_Cursor = "IBeam") ;当前显示的鼠标光标类型,IBeam(工字光标, 文本选择--输入)
SendInput, ^+8 ;这个在'输入语言热键'里设置的,一键切换到小狼毫的按键
Else
SendInput, ^+9 ;这是直接切换到英语的热键
Return
#IfWinActive
直接切换到某一输入法的热键是我在系统里设置好的。
这段脚本在chrme、notepad还有搜索里运行良好,在PS和AI的另存为窗口里也运行良好,但在PS和AI本体里完全无效,想请教大家,这种情况该怎么办,谢谢。
大家好,因为在PS和AI中很多快捷键都是单个按键的, 所以需要关闭中文输入法,但有时又需要输入中文,基本每次用久了都会发生在按快捷键的时候,却打开了输入框的情况,很让人恼火。我打算通过A_Cursor来获取鼠标状态,使只有在要输入文字的时候才打开中文输入法,在其他情况下都保持英文输入法。我写的代码如下:
[code]
GroupAdd, DesignerGroup, ahk_class illustrator ;把需要这个功能的软件编组
GroupAdd, DesignerGroup, ahk_class Photoshop
GroupAdd, DesignerGroup, ahk_class GHOST_WindowClass
#IfWinActive, ahk_group DesignerGroup
; #IfWinActive, ("ahk_class Photoshop") or WinActive("ahk_class illustrator") or WinActive("ahk_class GHOST_WindowClass")
~LButton::
If (A_Cursor = "IBeam") ;当前显示的鼠标光标类型,IBeam(工字光标, 文本选择--输入)
SendInput, ^+8 ;这个在'输入语言热键'里设置的,一键切换到小狼毫的按键
Else
SendInput, ^+9 ;这是直接切换到英语的热键
Return
#IfWinActive
[/code]
[img]https i.loli.net /2020/07/07/oKqERuwvcDPpLie.png[/img] 直接切换到某一输入法的热键是我在系统里设置好的。
这段脚本在chrme、notepad还有搜索里运行良好,在PS和AI的另存为窗口里也运行良好,但在PS和AI本体里完全无效,想请教大家,这种情况该怎么办,谢谢。