Rank: Advanced Member
Groups: Moderators, Approved Joined: 4/23/2020(UTC) Posts: 161 Thanks: 46 times Was thanked: 23 time(s) in 17 post(s)
|
Originally Posted by: Rob You're very welcome!
It seems it was just something I failed to account for. It is still the problem of the state of the input, as it is that there is the state in the Chinese input method, like Cn and En, and it can be switch by Win+Space. I used a default Chinese input method and a US keyboard installed from the US language, so the state could be recognized by Keyboard-Layout if I execute Win+Space, then display some words on the screen, but now it can't work well for some reason. Last time, I found the Windows API ImmGetConversionStatus() that didn't work in the S+. I find that the state of the input can be recognized by call the DLL of windows, like in Autohotkey. So I still like the text display style in S+. The following is the code written by a Japanese to get the state of the input. If it is convenient for you to help me consider whether it can be written as a plugin-in to use in the S+. https://qiita.com/shufo/items/84447520973dfc27733dIt seems that IME_GET() = 1 is Cn, and 0 is En, and it also can set the default input method to the particulate programs like CMD uses En, Word uses Cn, though there is a setting in windows to set the different program to separate input method. Code:
IME_GET(WinTitle="")
;-----------------------------------------------------------
; IMEの状態の取得
; 対象: AHK v1.0.34以降
; WinTitle : 対象Window (省略時:アクティブウィンドウ)
; 戻り値 1:ON 0:OFF
;-----------------------------------------------------------
{
ifEqual WinTitle,, SetEnv,WinTitle,A
WinGet,hWnd,ID,%WinTitle%
DefaultIMEWnd := DllCall("imm32\ImmGetDefaultIMEWnd", Uint,hWnd, Uint)
;Message : WM_IME_CONTROL wParam:IMC_GETOPENSTATUS
DetectSave := A_DetectHiddenWindows
DetectHiddenWindows,ON
SendMessage 0x283, 0x005,0,,ahk_id %DefaultIMEWnd%
DetectHiddenWindows,%DetectSave%
Return ErrorLevel
}
IME_SET(setSts, WinTitle="")
;-----------------------------------------------------------
; IMEの状態をセット
; 対象: AHK v1.0.34以降
; SetSts : 1:ON 0:OFF
; WinTitle: 対象Window (省略時:アクティブウィンドウ)
; 戻り値 1:ON 0:OFF
;-----------------------------------------------------------
{
ifEqual WinTitle,, SetEnv,WinTitle,A
WinGet,hWnd,ID,%WinTitle%
DefaultIMEWnd := DllCall("imm32\ImmGetDefaultIMEWnd", Uint,hWnd, Uint)
;Message : WM_IME_CONTROL wParam:IMC_SETOPENSTATUS
DetectSave := A_DetectHiddenWindows
DetectHiddenWindows,ON
SendMessage 0x283, 0x006,setSts,,ahk_id %DefaultIMEWnd%
DetectHiddenWindows,%DetectSave%
Return ErrorLevel
}
|