<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Раскладка клавиатуры в зависимости от программы]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=12395</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12395&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Раскладка клавиатуры в зависимости от программы».]]></description>
		<lastBuildDate>Thu, 02 Feb 2017 12:06:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=111795#p111795</link>
			<description><![CDATA[<p><span style="color: green"><strong>dorianleven</strong><br />Также учтите, что в конце предложений точки обязательны (исправьтесь), как и выполнение других правил. Лучше сперва прочесть, прежде чем опять нарушать.</span></p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Thu, 02 Feb 2017 12:06:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=111795#p111795</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=111794#p111794</link>
			<description><![CDATA[<p><strong>Flasher</strong><br />Спасибо, учту</p>]]></description>
			<author><![CDATA[null@example.com (dorianleven)]]></author>
			<pubDate>Thu, 02 Feb 2017 12:04:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=111794#p111794</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=111793#p111793</link>
			<description><![CDATA[<p><span style="color: green"><strong>dorianleven</strong><br />Добавил префикс в заголовок. В следующие разы делайте это самостоятельно.<br />Правила в шапке форума к прочтению обязательны.</span></p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Thu, 02 Feb 2017 12:02:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=111793#p111793</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Раскладка клавиатуры в зависимости от программы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=111792#p111792</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (dorianleven)]]></author>
			<pubDate>Thu, 02 Feb 2017 11:58:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=111792#p111792</guid>
		</item>
	</channel>
</rss>
