Ich schlage vor, mit der gleichen Autohotkey-Lösung wahrscheinlich etwas besser vorzugehen.
Anstatt zum vorherigen Layout zu wechseln (welches das dritte sein könnte), deaktivieren Sie besser die native Tastenkombination Alt + Umschalt, um das Layout zu wechseln.
Verwenden Sie das folgende Skript, möglicherweise mit den gewünschten Anpassungen:
#SingleInstance force
SendMode Input
; Cycled list of language ids
; refer to https://docs.microsoft.com/en-us/windows/win32/intl/language-identifiers
; and https://docs.microsoft.com/en-us/windows/win32/intl/language-identifier-constants-and-strings
; for finding out correct values
; in this case 0x409 means standard US English, and 0x419 means standard Russian
AltShiftLangs := [0x0409, 0x0419]
; 0x411 means japanese IME
CtrlAltLang := 0x0411
; This returns currently active language id
GetKeyboardLayout() {
WinGet, WinID,, A
ThreadID:=DllCall("GetWindowThreadProcessId", "UInt", WinID, "UInt", 0)
return DllCall("GetKeyboardLayout", "UInt", ThreadID, "UInt") & 0xFFFF
}
; This sends request to change system language to lang argument
SetKeyboardLayout(lang) {
PostMessage, 0x50,, lang,, A
}
; This returns 0-based index of Value in Arr
IndexOf(Arr, Value) {
Loop % Arr.Length()
if Arr[A_Index] == Value {
return A_Index-1
}
return -1
}
; This sets language based on current system lanuage and next value by index in Arr
; If current language is not found, it sets system to first language from Arr
SetNextLanguage(Arr) {
lang := GetKeyboardLayout()
idx := IndexOf(Arr, lang)
if (idx < 0) {
SetKeyboardLayout(Arr[1])
return
}
nextIdx := mod(idx+1, Arr.Length())
next := Arr[nextIdx+1]
SetKeyboardLayout(next)
}
; Alt+Shift hotkey - cycle between AltShiftLangs
LAlt & LShift::
SetNextLanguage(AltShiftLangs)
return
; Ctrl+Alt hotkey - switch directly to isolated CtrlAltLang
LCtrl & LAlt::
SetKeyboardLayout(CtrlAltLang)
return