<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Переменные гор. клавиши на Win 8]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10652</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10652&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Переменные гор. клавиши на Win 8».]]></description>
		<lastBuildDate>Thu, 21 May 2015 21:22:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94126#p94126</link>
			<description><![CDATA[<p>Спасиб )</p>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Thu, 21 May 2015 21:22:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94126#p94126</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94125#p94125</link>
			<description><![CDATA[<div class="codebox"><pre><code>#If CheckWin(WinExist(&quot;A&quot;))   ; здесь нужная функция
SetHotkey(&quot;$q&quot;, &quot;ProcFunc1&quot;)
SetHotkey(&quot;$ц&quot;, &quot;ProcFunc2&quot;)
SetHotkey(&quot;$e&quot;, &quot;ProcFunc3&quot;)
Return

ProcFunc1:
   MsgBox, TEST1
   Return

ProcFunc2:
   MsgBox, TEST2 
   Return

ProcFunc3:
   MsgBox, TEST3
   Return
   
CheckWin(hwnd)  {
   WinGetClass, WindowClass, ahk_id %hwnd%   ; здесь вместо этого любая проверка
   if (WindowClass = &quot;Notepad&quot;)
      Return true
}
   
SetHotkey(hotkey, label)  {
   ChangeLayout(hotkey)
   Hotkey, % hotkey, % label
}

ChangeLayout(hotkey)  {
   static WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_SYSCHARSET := 1

   layout := RegExMatch(hotkey, &quot;i)[а-я]&quot;) ? 0x4190419 : 0x4090409
   DllCall(&quot;SendMessage&quot;, Ptr, A_ScriptHwnd, UInt, WM_INPUTLANGCHANGEREQUEST, Ptr, INPUTLANGCHANGE_SYSCHARSET, Ptr, layout, Ptr)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 21 May 2015 20:53:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94125#p94125</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94124#p94124</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, Спасиб, но <span class="bbu">ahk_class Notepad</span> это условность. В реальности там функция с кучей условий и жёсткая привязка к <span class="bbu">Notepad </span> не канает.</p><div class="codebox"><pre><code>
MyKey1 = q

ChangeLayout(MyKey1)
Hotkey, % &quot;$&quot; MyKey1, ProcFunc1
return

ProcFunc1:
   WinGet, active_id, ID, A 
   if CheckWin(active_id)
      MsgBox, TEST1
   else
      Send {%MyKey1%}
Return

ChangeLayout(hotkey)  {
   static WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_SYSCHARSET := 1

   layout := RegExMatch(hotkey, &quot;i)[а-я]&quot;) ? 0x4190419 : 0x4090409
   DllCall(&quot;SendMessage&quot;, Ptr, A_ScriptHwnd, UInt, WM_INPUTLANGCHANGEREQUEST, Ptr, INPUTLANGCHANGE_SYSCHARSET, Ptr, layout, Ptr)
}
</code></pre></div><p>Получается, что только при отправке надо определять какая раскладка и посылать нужный символ ?<br />Пожалуйста, подскажи как подправить ))</p>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Thu, 21 May 2015 20:31:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94124#p94124</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94123#p94123</link>
			<description><![CDATA[<div class="codebox"><pre><code>Hotkey, IfWinActive, ahk_class Notepad
SetHotkey(&quot;$q&quot;, &quot;ProcFunc1&quot;)
SetHotkey(&quot;$ц&quot;, &quot;ProcFunc2&quot;)
SetHotkey(&quot;$e&quot;, &quot;ProcFunc3&quot;)
Return

ProcFunc1:
   MsgBox, TEST1
   Return

ProcFunc2:
   MsgBox, TEST2 
   Return

ProcFunc3:
   MsgBox, TEST3
   Return
   
SetHotkey(hotkey, label)  {
   ChangeLayout(hotkey)
   Hotkey, % hotkey, % label
}

ChangeLayout(hotkey)  {
   static WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_SYSCHARSET := 1

   layout := RegExMatch(hotkey, &quot;i)[а-я]&quot;) ? 0x4190419 : 0x4090409
   DllCall(&quot;SendMessage&quot;, Ptr, A_ScriptHwnd, UInt, WM_INPUTLANGCHANGEREQUEST, Ptr, INPUTLANGCHANGE_SYSCHARSET, Ptr, layout, Ptr)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 21 May 2015 19:56:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94123#p94123</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94111#p94111</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, спасиб огромное.</p><p>А как сделать, чтобы отсылалась клавиша текущей раскладки, когда окно не Notepad ?</p><p>MyKey1 = q<br />Send {%MyKey1%} </p><p>Т.е. если <strong>ENG</strong> то в окно посылается &quot;q&quot;, если <strong>РУС</strong>, то &quot;й&quot;</p>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Wed, 20 May 2015 22:31:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94111#p94111</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94088#p94088</link>
			<description><![CDATA[<div class="codebox"><pre><code>MyKey1 = q
MyKey2 = ц
MyKey3 = e

ChangeLayout(MyKey1)
Hotkey, % &quot;$&quot; MyKey1, ProcFunc1

ChangeLayout(MyKey2)
Hotkey, % &quot;$&quot; MyKey2, ProcFunc2

ChangeLayout(MyKey3)
Hotkey, % &quot;$&quot; MyKey3, ProcFunc3
return

ProcFunc1:
   IfWinActive, ahk_class Notepad
      MsgBox, TEST1
   else
      Send {%MyKey1%}
Return

ProcFunc2:
   IfWinActive, ahk_class Notepad
      MsgBox, TEST2
   else
      Send {%MyKey2%}  
Return

ProcFunc3:
   IfWinActive, ahk_class Notepad
      MsgBox, TEST3
   else
      Send {%MyKey3%}  
Return

ChangeLayout(hotkey)  {
   static WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_SYSCHARSET := 1

   layout := RegExMatch(hotkey, &quot;i)[а-я]&quot;) ? 0x4190419 : 0x4090409
   DllCall(&quot;SendMessage&quot;, Ptr, A_ScriptHwnd, UInt, WM_INPUTLANGCHANGEREQUEST, Ptr, INPUTLANGCHANGE_SYSCHARSET, Ptr, layout, Ptr)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 20 May 2015 16:31:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94088#p94088</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94069#p94069</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, подскажи как интегрировать твой код в структуру типа :</p><div class="codebox"><pre><code>
MyKey1 = q
MyKey2 = w
MyKey3 = e

Hotkey, % &quot;$&quot; MyKey1, ProcFunc1
Hotkey, % &quot;$&quot; MyKey2, ProcFunc2
Hotkey, % &quot;$&quot; MyKey3, ProcFunc3
return

ProcFunc1:
   IfWinActive, ahk_class Notepad
      MsgBox, TEST1
   else
      Send {%MyKey1%}  
Return

ProcFunc2:
   IfWinActive, ahk_class Notepad
      MsgBox, TEST2
   else
      Send {%MyKey2%}  
Return

ProcFunc3:
   IfWinActive, ahk_class Notepad
      MsgBox, TEST3
   else
      Send {%MyKey3%}  
Return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Wed, 20 May 2015 09:31:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94069#p94069</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94047#p94047</link>
			<description><![CDATA[<p>Так можно попробовать:<br /></p><div class="codebox"><pre><code>MyHotkey := &quot;z&quot;
layout := RegExMatch(MyHotkey, &quot;i)[а-я]&quot;) ? 0x4190419 : 0x4090409

WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_SYSCHARSET := 1
DllCall(&quot;SendMessage&quot;, Ptr, A_ScriptHwnd, UInt, WM_INPUTLANGCHANGEREQUEST, Ptr, INPUTLANGCHANGE_SYSCHARSET, Ptr, layout, Ptr)

Hotkey, % MyHotkey, label, On
Return

label:
   MsgBox, % A_ThisHotkey
   Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 19 May 2015 11:46:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94047#p94047</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94046#p94046</link>
			<description><![CDATA[<p>Такое решение есть — использование кодов виртуальных клавиш или сканкодов.</p><p>Ну или запускайте ваш скрипт из другого, который предварительно переключит &quot;текущую раскладку&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Tue, 19 May 2015 11:22:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94046#p94046</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94045#p94045</link>
			<description><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p> Проблема в языке самого скрипта, а он соответствует языку ввода по умолчанию, установленному в системных настройках. Хотя в 8, помнится, не всё так однозначно.</p></blockquote></div><p>В WinXP и Win7 - соответствует языку ввода по умолчанию<br />В Win8 - языку текущей раскладки</p><p>Вот и требуется решение задачи для Win8 !!!</p>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Tue, 19 May 2015 10:34:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94045#p94045</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94044#p94044</link>
			<description><![CDATA[<p>Переключение языка активного окна тут ни при чём. Проблема в языке самого скрипта, а он соответствует языку ввода по умолчанию, установленному в системных настройках. Хотя в 8, помнится, не всё так однозначно.</p><p>Так что лучшее решение всё-таки vk.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Tue, 19 May 2015 10:05:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94044#p94044</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Переменные гор. клавиши на Win 8]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94043#p94043</link>
			<description><![CDATA[<div class="codebox"><pre><code>
KeyMy =  z

Hotkey, % &quot;$&quot; KeyMy, ProcFunc

return

ProcFunc:
   MsgBox, TEST
Return
</code></pre></div><p>Если стоит русская раскладка, то скрипт выдаёт ошибку.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p><span class="postimg"><img src="http://f5.s.qip.ru/1q1ISRms.png" alt="http://f5.s.qip.ru/1q1ISRms.png" /></span></p></div></div><p>Если ставлю в начале строку кода, чтобы переключал раскладку - всё равно не помогает (как-будто не успевает преключиться):</p><div class="codebox"><pre><code>
PostMessage, 0x50,, 0x4090409,, A   ; На английский

KeyMy =  z

Hotkey, % &quot;$&quot; KeyMy, ProcFunc

return

ProcFunc:
   MsgBox, TEST
Return
</code></pre></div><p>Как быть для Win8?</p><p><strong>p.s.</strong><br />Клавиши &quot;vk&quot; не предлагать )</p>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Tue, 19 May 2015 08:26:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94043#p94043</guid>
		</item>
	</channel>
</rss>
