<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK:Смена языка на Японский кнопкой CapsLock]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14230&amp;type=atom" />
	<updated>2018-10-11T05:40:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14230</id>
		<entry>
			<title type="html"><![CDATA[AHK:Смена языка на Японский кнопкой CapsLock]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129150#p129150" />
			<content type="html"><![CDATA[<p>По задумке язык должен переключаться на Японский нажатием CapsLock.А alt+shift переключать en-ru.Ничего не работает...Может кто-нибудь исправить мой говнокод?</p><div class="codebox"><pre><code>ru := DllCall(&quot;LoadKeyboardLayout&quot;, &quot;Str&quot;, &quot;0x4190419&quot;, &quot;Int&quot;, 1)
en := DllCall(&quot;LoadKeyboardLayout&quot;, &quot;Str&quot;, &quot;0x4090409&quot;, &quot;Int&quot;, 1)
jp := DllCall(&quot;LoadKeyboardLayout&quot;, &quot;Str&quot;, &quot;0x4110411&quot;, &quot;Int&quot;, 1)

CapsLock::
{
    PostMessage 0x50, 0, %jp%,, A
}

!~Shift UP::
{
    if GetKeyState(&quot;Alt&quot;) {
	    w := DllCall(&quot;GetForegroundWindow&quot;)
		pid := DllCall(&quot;GetWindowThreadProcessId&quot;, &quot;UInt&quot;, w, &quot;Ptr&quot;, 0)
		l :=DllCall(&quot;GetKeyboardLayout&quot;, &quot;Uint&quot;, pid)
		if (l = en) {
		        PostMessage 0x50, 0, %ru%,, A
		} else {
		    PostMessage 0x50, 0, %en%,, A
		}
		Exit
    }
}

~LAlt UP::
{
    if GetKeyState(&quot;Shift&quot;) {
        w := DllCall(&quot;GetForegroundWindow&quot;)
		pid := DllCall(&quot;GetWindowThreadProcessId&quot;, &quot;Uint&quot;, w, &quot;Ptr&quot;, 0)
		l :=DllCall(&quot;GetKeyboardLayout&quot;, &quot;UInt&quot;, pid)
		if (l = en) {
		    PostMessage 0x50, 0, %ru%,, A
		} else {
            PostMessage 0x50, 0, %en%,, A	
		}
		Exit
	}
}	</code></pre></div>]]></content>
			<author>
				<name><![CDATA[gurutaminoviy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39574</uri>
			</author>
			<updated>2018-10-11T05:40:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129150#p129150</id>
		</entry>
</feed>
