Skip to content

Commit

Permalink
fix: 讯飞语音输入法切换路径读取和窗口点击切换修复
Browse files Browse the repository at this point in the history
  • Loading branch information
snomiao committed Apr 15, 2021
1 parent e4092c2 commit 759748e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Modules/应用-讯飞输入法语音悬浮窗.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
; @description 如题
; @author [email protected]
; @version 2.1.1(20200606)

;
; 2021-04-15 更新 @telppa:[修改了一下语音识别模块的代码。・Issue #14・snolab/CapsLockX]( https://github.com/snolab/CapsLockX/issues/14 )
;
CapsLockX_AppendHelp("
(
讯飞语音悬浮窗
Expand All @@ -12,25 +14,28 @@ CapsLockX_AppendHelp("
Return

#IF !CapsLockXMode
#if !CapsLockXMode

#h::
If (WinExist("ahk_class UIIFlyVoiceFrame ahk_exe iFlyVoice.exe")){
; 原方案使用热键触发
; Send ^+h
; 新方案直接发送模拟点击消息
ControlClick, x0 y0, ahk_class UIIFlyVoiceFrame ahk_exe iFlyVoice.exe
#h:: 讯飞语音输入法切换()
讯飞语音输入法切换(){
; 注册表里取路径
RegRead, iFlyPath, HKLM\SOFTWARE\iFly Info Tek\iFlyIME, Install_Dir_Ver2
; 非空检查,确保 iFlyPath 有值
iFlyPath := (iFlyPath ? iFlyPath : "C:\Program Files (x86)\iFly Info Tek\iFlyIME\2.1.1708")
iFlyWnd := WinExist("ahk_class UIIFlyVoiceFrame ahk_exe iFlyVoice.exe" )
If (iFlyWnd){
ControlClick, x20 y20, ahk_id %iFlyWnd%
}Else{
If (FileExist("C:\Program Files (x86)\iFly Info Tek\iFlyIME\2.1.1708\iFlyVoice.exe")){
Run "C:\Program Files (x86)\iFly Info Tek\iFlyIME\2.1.1708\iFlyVoice.exe"
If (FileExist(iFlyPath "\iFlyVoice.exe")){
Run "%iFlyPath%\iFlyVoice.exe"
}else{
MsgBox, 4, , 你似乎还没有安装讯飞语音输入法,是否现在下载安装包并【手动安装】到默认目录?
IfMsgBox, NO, Return
UrlDownloadToFile https://download.voicecloud.cn/200ime/iFlyIME_Setup_2.1.1708.exe, %TEMP%/iFlyIME_Setup_2.1.1708.exe
Run %TEMP%/iFlyIME_Setup_2.1.1708.exe
}
}
Return
}

; 加 Alt 访问原热键
#!h:: Send #h

0 comments on commit 759748e

Please sign in to comment.