<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Раскладка клавиатуры в зависимости от программы]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12395&amp;type=atom" />
	<updated>2017-02-02T12:06:50Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12395</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111795#p111795" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>dorianleven</strong><br />Также учтите, что в конце предложений точки обязательны (исправьтесь), как и выполнение других правил. Лучше сперва прочесть, прежде чем опять нарушать.</span></p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-02T12:06:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111795#p111795</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111794#p111794" />
			<content type="html"><![CDATA[<p><strong>Flasher</strong><br />Спасибо, учту</p>]]></content>
			<author>
				<name><![CDATA[dorianleven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34598</uri>
			</author>
			<updated>2017-02-02T12:04:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111794#p111794</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111793#p111793" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>dorianleven</strong><br />Добавил префикс в заголовок. В следующие разы делайте это самостоятельно.<br />Правила в шапке форума к прочтению обязательны.</span></p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-02T12:02:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111793#p111793</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111792#p111792" />
			<content type="html"><![CDATA[<p>Привет всем. Я в работе использую Autodesk Maya, чтобы в ней работали хоткеи должен быть установлен Англ. язык.<br />Переключение языка сделал на англ, но встал вопрос как вернуть на предыдущий язык когда окно перестает быть активным?<br />Копался на форуме, но не нашел подходящий блок кода. По задумке скрипт запоминает текущую раскладку и переключает ее при активации Maya на англ, когда окно становится неактивным возвращает предыдущую раскладу.&nbsp; На данный момент он всегда переключает на русский, когда окно становится неактивным. Подскажите, пожалуйста, как исправить.</p><p><strong>Сборная солянка:</strong></p><div class="codebox"><pre><code>#SingleInstance force
SetFormat, Integer, H
state := 0
Loop
{
   
GetInputLangID(window)
{
    If !(hWnd := WinExist(window))
        return
 
    WinGetClass, Class
 
    if (Class == &quot;ConsoleWindowClass&quot;)
    {
        WinGet, consolePID, PID
        DllCall(&quot;AttachConsole&quot;, Ptr, consolePID)
        VarSetCapacity(buff, 16)
        DllCall(&quot;GetConsoleKeyboardLayoutName&quot;, Str, buff)
        DllCall(&quot;FreeConsole&quot;)
        langID := &quot;0x&quot; . SubStr(buff, -3)
    }
    Else
        langID := DllCall(&quot;GetKeyboardLayout&quot;, Ptr, DllCall(&quot;GetWindowThreadProcessId&quot;, Ptr, hWnd, UInt, 0, Ptr), Ptr) &amp; 0xFFFF
 
    return langID
}
 
GetInputLangName(langId)
{
    Size := (DllCall(&quot;GetLocaleInfo&quot;, UInt, langId, UInt, 0x1001, UInt, 0, UInt, 0) * 2)   ; LOCALE_SENGLANGUAGE := 0x1001
    VarSetCapacity(localeSig, Size, 0)
  curlng:= DllCall(&quot;GetLocaleInfo&quot;, UInt, langId, UInt, 0x1001, Str, localeSig, UInt, Size)
    return localeSig
}
{
WinWaitActive, Autodesk Maya
{
state := 1
}
if (state=1)
{
PostMessage, 0x50,, 0x4090409,, A ; english layout
SetCapsLockState, off
}
WinWaitNotActive, Autodesk Maya
{
state := 0
}

if (state=0)
{
   PostMessage, 0x50,, % langID,, A ;
}
}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[dorianleven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34598</uri>
			</author>
			<updated>2017-02-02T11:58:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111792#p111792</id>
		</entry>
</feed>
