What's wrong with my keyboard switching script?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RankkaApina
Posts: 1
Joined: 09 May 2021, 13:15

What's wrong with my keyboard switching script?

09 May 2021, 13:24

I use several different keyboards and I wanted an easy way to switch to a specific keyboard (which is a functionality that is supposed to be in Windows 10, but I didn't get it to work from the official options). Anyway, I wrote the following script and it mostly works. My default keyboard is the English one (1), and the switching seems to work, except when I want to switch back to English: it does look like the language is English, but if I start writing, the writing comes out in Persian (not really desirable especially if trying to write an internet address...). Can anyone see what I'm doing wrong? Just to note: the English (international) - anna keyboard is based on the international US keyboard for windows 10, but I've added the macrons which are used in Maori. I've made it with the Microsoft Keyboard Layout Creator. Could that be an issue? I haven't seen any other weird functionality from it.

Code: Select all

^1::SetInputLang(0x0409) ; English (international) - anna
^2::SetInputLang(0x0419) ; Russian phonetic
^3::SetInputLang(0x0411) ; Japanese
^4::SetInputLang(0x0429) ; Persian

SetInputLang(Lang)
{
    WinExist("A")
    ControlGetFocus, CtrlInFocus
    PostMessage, 0x50, 0, % Lang, %CtrlInFocus%
}
[Mod edit: [code][/code] tags added.]

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, ArkuS, Nerafius and 109 guests