It occurred to me that you can probably prevent the language switch by sending a keystroke, just as AutoHotkey sends the
mask key to prevent the window menu or Start menu from appearing. So I did some experimentation and learned a few things.
The Input command was also suppressing the key-up event of &/7, as it is designed to do. If you wait for the key to be released before calling Input, the system will see the key-release and so will not switch language (when ^& uses the "reg" hotkey method, at least).
Code: Select all
^&::
KeyWait &
Input key, I C L1 T1
;...
However, this does not work if you release Ctrl or Shift before &/7, since in that case there is no event between Ctrl/Shift press and release. Instead, you can immediately "release" the key:
Code: Select all
^&::
SendInput {Blind}{& up}
Input key, I C L1 T1
;...
Hook hotkeys will also cause this issue, because both key-press and key-release are suppressed. For example, just pressing this hotkey activates the language switch:
Sending any keyboard events (except Ctrl/Shift up) will suppress the language switch. I would suggest vk07 since it probably has no effect:
Code: Select all
Send {Blind}{vk07 up} ; Just the up event is sufficient.
This is not needed if you are sending some other keys (but you must send them before Ctrl or Shift is released).