Code: Select all
>+home:: ; RShift + Home
send {lalt down}{Tab}
KeyWait rshift
send {lalt Up}
return
Code: Select all
>+home:: ; RShift + Home
send {lalt down}{Tab}
KeyWait rshift
send {lalt Up}
return
Code: Select all
*>+Home::Send {Alt down}{Tab}
!RShift Up::Send {Alt up}
I have tested this script on my computer with Windows 11. The keyboard languages (English and Russian) still switch when the script is run. When you test the script on your computer, does the same happen (if you have more than one keyboard language)?mikeyww wrote: ↑04 Oct 2022, 18:39Perhaps:
Code: Select all
*>+Home::Send {Alt down}{Tab} !RShift Up::Send {Alt up}
Code: Select all
If !Instr(A_AhkPath, "UIA") && !(DllCall("GetCommandLine", "str") ~= " /restart(?!\S)") {
SplitPath, A_AhkPath, fn ; https://www.autohotkey.com/docs/Program.htm#Installer_uiAccess
If FileExist(ahk := StrReplace(A_AhkPath, fn, "AutoHotkeyU64_UIA.exe")) {
Try Run "%ahk%" /restart "%A_ScriptFullPath%"
ExitApp
} Else MsgBox, 48, Failure, File not found.`n`n%ahk%
}
*>+Home::Send {Blind}{Shift up}{Alt down}{Tab}
!RShift Up::Send {Alt up}
Modifier keys are restored differently to allow a Send to turn off a hotkey's modifiers even if the user is still physically holding them down.
When I press RAlt + LShift, the keyboard languages are not switched. However, when I press RShift + Home to run the following script, the languages are switched:I was surprised to find that RAlt+LShift switched keyboards. I wonder if this is a Windows bug.
Code: Select all
*>+Home::Send {Alt down}{Tab}
!RShift Up::Send {Alt up}
Code: Select all
*>+Home::Send {Blind}{Shift up}{Alt down}{Tab}
!RShift Up::Send {Alt up}
Code: Select all
If !Instr(A_AhkPath, "UIA") && !(DllCall("GetCommandLine", "str") ~= " /restart(?!\S)") {
SplitPath, A_AhkPath, fn ; https://www.autohotkey.com/docs/Program.htm#Installer_uiAccess
If FileExist(ahk := StrReplace(A_AhkPath, fn, "AutoHotkeyU64_UIA.exe")) {
Try Run "%ahk%" /restart "%A_ScriptFullPath%"
ExitApp
} Else MsgBox, 48, Failure, File not found.`n`n%ahk%
}