1

I type in the following 3 languages:

Language A - 55% of the time

Language B - 40% of the time

Language C - 5% of the time

The usual solution would be to have all three languages installed and use Ctrl/Alt-Shift, however it is quite annoying to have to switch over Language C each time I swap back and forth between A and B.

Is there some sort of solution that would allow me to prevent Windows from switching over to language C when I press Ctrl/Alt-Shift? I could then add a separate hotkey for switching over to Language C.

I'm using Windows 7 SP1.

Thank you.

2 Answers 2

1

You can create Autoit script for "skip" Language "C" when switch keyboard language.

After install Autoit and Editor. Right click on desktop->New->Autoit Script. Right click on this created file->Edit. Now you should see ScITE window and after line "Add your code below here" add this code:

#include <WinAPISys.au3>
ClipPut(_WinAPI_GetKeyboardLayout(ControlGetHandle("[ACTIVE]","","")))

Press SHIFT+ALT(or which hotkeys registered for switch keyboard language) until your current language will be "C"(if keyboard language name not show up in taskbar press Win+R ->> CTFMON.EXE ->> Enter) then in the ScITE window press Tools->Go. Now in your clipboard Language "C" code. Paste(CTRL+V) and save it somewhere.

Remove previous code and paste this:

#include <WindowsConstants.au3>
#include <WinAPISys.au3>
#include <String.au3>
#NoTrayIcon
$skiplang="0x04090409" ;skip this language when switch language
$list=_WinAPI_GetKeyboardLayoutList ( )

$fakeforwardlang=""
If IsArray($list) Then
    if $list[0]<3 then Exit; you potato
    For $i = 1 To $list[0]
        if $list[$i]=$skiplang Then;find next lang
            if $i=$list[0] then
                $fakeforwardlang=$list[1]
                ExitLoop
            EndIf
            $fakeforwardlang=$list[$i+1]
            ExitLoop
        EndIf
    Next
Else
    Exit
EndIf
$fakeforwardlang=StringMid($fakeforwardlang,1,6)
while 1
$handle=ControlGetHandle("[ACTIVE]","","")
if getcurkb($handle)=$skiplang then _WinAPI_SetKeyboardLayout($handle, $fakeforwardlang)
Sleep(100)
wend
Func getcurkb($handle)
    Return _WinAPI_GetKeyboardLayout($handle)
EndFunc

For next step need replace saved language "C" code with 0x04090409 in this script(5 line).

Then in SciTE window press Tools->Build. Now you will get executable in same directory where was Autoit script. Run this executable(.exe).

Need use task manager for kill process if want stop script.

Works on Windows 7 with 3 keyboard language and disabled UAC.

Update:

I screw up. _WinAPI_SetKeyboardLayout Forward work only sometimes. Standard send very buggy when {down} key pressed. Current solution based on external function. But one issue with this function you need unpress shift and alt for switch to next keyboard language. Should recheck code later.

Update2:

Back to _WinAPI_SetKeyboardLayout but using fake forward. I can't find any issues now.

0
1

I have the same situation and set different hot keys for each language, e.g.:

  • Ctrl+Shift+1 for language A,
  • Ctrl+Shift+2 for language B,
  • Ctrl+Shift+3 for language C

That allows to switch to desired language in just one keystroke. This can be set in Control Panel\All Control Panel Items\Language\Advanced settings\Change language bar hot keys (it is the path from Windows 10, on Windows 7 it may be different, but somewhere similar). The dialog looks like this: Change key sequence

You must log in to answer this question.

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