How to check language and switch it if need? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
xxl0o
Posts: 2
Joined: 29 Aug 2018, 16:58

How to check language and switch it if need?

30 Aug 2018, 03:22

Hi. Below is my script for Adobe Premiere. If my keyboard layout is English - it works fine. But if my keyboard layout is set to my native language - it fails. So my question is: how can I change this code to check if my language layout is not English and switch it to English? And how to do nothing if it`s English already. I`m new here. Tried to find solution by myself, but my ahk skills are at a very low level. :crazy:

Code: Select all

CoordMode, Mouse, screen
CoordMode, Pixel, screen

#IfWinActive ahk_exe Adobe Premiere Pro.exe

^m::
	MouseGetPos, xpos, ypos	
	SetKeyDelay, 0
	Send s
	MouseClick, left, 1028, 317
	MouseClick, left, 1028, 317
	Send 0.6
	Sleep 500
	Send  {Enter}
	MouseMove, xpos, ypos
	
#IfWinActive
YMP2
Posts: 48
Joined: 20 Apr 2014, 06:55

Re: How to check language and switch it if need?  Topic is solved

31 Aug 2018, 06:31

You don't need to check it, just switch to English.

Code: Select all

WinExist("A")
ControlGetFocus, CtrlFocus
PostMessage, 0x50, 0, 0x4090409, %CtrlFocus%
0x50 is WM_INPUTLANGCHANGEREQUEST and 0x4090409 is US English.
xxl0o
Posts: 2
Joined: 29 Aug 2018, 16:58

Re: How to check language and switch it if need?

31 Aug 2018, 08:00

Thank you, man! You rocks! \m/ It works great (I had to add sleep 500).

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 268 guests