6

How could I have three or more input languages active (namely English/Russian/Chinese), but cycle with Alt+Shift only between two of them (English/Russian)?

Punto Switcher handles this task only with custom shortcuts like Caps Lock or right Ctrl.

1

2 Answers 2

3

I solved this problem using AutoHotKey.

Set up 3 languages, a hotkey for switching between them and another hotkey for switching to the language you want to skip. I had English, Russian and Japanese and wanted to skip Japanese so I assigned Ctrl+Shift+0 to switch to JP.

I already had an AutoHotKey script that allowed me to switch between all the 3 languages using Caps. It looked like this:

CapsLock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}

The idea is to switch the language automatically once you switched to the language you want to skip. It's 0x0411 for Japanese. Paste yours in the if clause in the script below, save it and run it.

Here is the list of language ids, find yours in the first column.

The script only works for switching between languages using CapsLock but you can adapt it to Alt+Shift switch. Probably just by replacing "CapsLock" with "{Alt Down}{Shift Down}{Shift Up}{Alt Up}".

CapsLock::
Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}

if !LangID := GetKeyboardLanguage(WinActive("A"))
{
    MsgBox, % "GetKeyboardLayout function failed " ErrorLevel
    return
}

if (LangID = 0x0411)
    Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
return

GetKeyboardLanguage(_hWnd=0)
{
    if !_hWnd
        ThreadId=0
    else
        if !ThreadId := DllCall("user32.dll\GetWindowThreadProcessId", "Ptr", _hWnd, "UInt", 0, "UInt")
            return false

    if !KBLayout := DllCall("user32.dll\GetKeyboardLayout", "UInt", ThreadId, "UInt")
        return false

    return KBLayout & 0xFFFF
}
1
  • A good solution - I could not bind a hotkey to Ctrl+Shift (perhaps because both are modifier keys?) so I instead made the program check for the current language now and then and send a Ctrl+Shift press if it's a one we don't want (with a hotkey for switching which one is that). This way I have the language list go either EN↔UA or EN↔RU. Sep 6, 2023 at 14:56
-1

On the Advanced Key Settings tab (in the Text Services and Input Languages dialog) you can change the keyboard shortcut for each language you have set.

By default, the "Between input languages" action is set to Left Alt+Shift, like you mentioned. The other actions ("To English", "To Russian", etc.) won't have a shortcut assigned until you manually set it to one of your liking.

1
  • 2
    Yep, I know that. But it's hard to unlearn to switch between languages on Alt+Shift. What I would like is switching between En&Ru by Alt+Shift, and switching to Chinese by some other shortcut. May 31, 2010 at 3:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .