You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modified remapping is a mapping explicitly declared with tweaks.
A modified LAlt::LAlt for example
The {Shift} between keydown and keyup should prevent most programs from focusing menu. Without {Blind} at keydown, Shift should be pushed back when needed.
The KeyWait might prevent side effects due to repeated keydown. But it does not affect the behavior when you are physically holding Alt down. For example in Explorer, you can still hold Alt and drag a file to crate a shortcut. And in Firefox, you can still hold Alt and select the text of hyperlinks without opening them.
I might not have covered all the possibilities, so feel free to try your own modifications with programs you use.
In case you have issue with Alt+Shift with the current approach.
The {Ctrl up} between keydown and keyup should prevent most programs from focusing menu. Note that {Ctrl up} is better than {Ctrl} because of less keystrokes and less possibility of side effects.
In some programs such as Task Manager, you need {vkFF up} immediately after keydown to suppress keytips.
Sending {Ctrl up} here might cause issues for hotkeys with Ctrl (e.g. !a::Send "^a"), so a {vkFF up} instead.
On the other hand, sending {vkFF up} at keydown generally may cause other issues. For example if you have a hotkey !c::Send "^{Ins}" and try to select and copy text form a terminal with a remote session, sending a {vkFF up} at keydown might refresh the output and thus cancel the selection before C is even pressed.
Make sure CpasLock is always off with SetCapsLockState "AlwaysOff".
This example uses LAlt for English (1033), and RAlt for Japanese (1041). Find your LANGID here.
You need KeyWait at keydown for proper A_TimeSincePriorHotkey. The threshold here is 200 ms. You can change the number or omit the condition as you wish.
If you use CapsLock as a custom modifier, add || GetKeyState("CapsLock","P") inside !().
For Japanese, send ^{vkF2} to ensure Hiragana mode after switching. You can also send !{vkF1} for Katakana. If you use other languages, this statement can be safely omitted.
Just a tip: to guard against a nonexisting active window you might want to fallback to shortcuts
if not WinExist("A") { ; no window to post message to, use shortcuts (must be set in the OS settings "Text Services and Input Language")if target = 'en' { ; this is from a general layout toggle function, for you more narrow case can just use specific shortcut in each LAlt/RAltSendInput('+!6')
} else if target = 'jap' {
SendInput('+!7')
} else { ; not needed for your specific case, but for a general layout switching function that can also toggleSendInput('#{Space}')
}
return
}
Just a tip: to guard against a nonexisting active window you might want to fallback to shortcuts