<?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=8367</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8367&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Как корректно задать переменный хоткей ?».]]></description>
		<lastBuildDate>Tue, 15 Dec 2015 08:56:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=99683#p99683</link>
			<description><![CDATA[<p>В документации есть команда <em>Hotkey</em>.</p><p>И элемент управления GUI &quot;Hotkey&quot;:<br /></p><div class="quotebox"><cite>Валентина Гаврикова пишет:</cite><blockquote><p>горячая клавиша сохраняется в выходной переменной, ассоциированной с элементом управления</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Tue, 15 Dec 2015 08:56:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=99683#p99683</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=99679#p99679</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, спасибо! Про смену горячих клавиш посредством оконного интерфейса понятно. А имеется ли на форуме пример оформления такого интерфейса? Или, может, кто-нибудь сделает выдержку из существующего скрипта с соответствующей функцией? Если это оффтоп, то создам отдельную тему.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Tue, 15 Dec 2015 00:14:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=99679#p99679</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=99675#p99675</link>
			<description><![CDATA[<p>Если хоткей нельзя сразу явно прописать в скрипте, например, если предусматривается, что его может выбрать и потом поменять пользователь через какой-то оконный интерфейс.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 14 Dec 2015 18:00:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=99675#p99675</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=99674#p99674</link>
			<description><![CDATA[<p>Объясните, пожалуйста, в каких случаях необходим такой &quot;хоткей через переменную&quot;, который описывается в данной теме. Было бы еще яснее, если будет представлен пример сценария, в котором горячая клавиша без данной функции не работает. Спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Mon, 14 Dec 2015 17:50:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=99674#p99674</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=78253#p78253</link>
			<description><![CDATA[<div class="quotebox"><cite>Ekklesiast пишет:</cite><blockquote><p>спойлерить код, длиною в пол страницы</p></blockquote></div><p>Неважно, какой размер кода, всё равно он ограничивается размером своего окна при применении соответствующего тега.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 19 Dec 2013 13:38:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=78253#p78253</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=78252#p78252</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p><strong>Ekklesiast</strong>, не нужно код стыдливо прятать под спойлер.</p></blockquote></div><p>А я думал что: &quot;спойлерить код, длиною в пол страницы&quot; - это в негласное правило корректного форматирования. ))))</p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Вот пример:</p></blockquote></div><p>Спасиб, разобрался.</p>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Thu, 19 Dec 2013 13:35:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=78252#p78252</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=78247#p78247</link>
			<description><![CDATA[<p><strong>Ekklesiast</strong>, не нужно код стыдливо прятать под спойлер.<br />Вот пример:<br /></p><div class="codebox"><pre><code>key := &quot;z&quot;

Gui, 1:Margin, 0, 0
Gui, 1:Add, Edit, w250 h100
Gui, 1:Show, % &quot;x&quot; A_ScreenWidth//2 -255, Клик

Gui, 2:Margin, 0, 0
Gui, 2:Add, Edit, w250 h100
Gui, 2:Show, % &quot;x&quot; A_ScreenWidth//2 + 5, Посыл буквы

SetFormat, IntegerFast, H
vk_code := &quot;vk&quot; SubStr(GetKeyVK(key), 3)
Hotkey, % &quot;$&quot; vk_code, Label, On
return

Label:
   WinGetActiveTitle, Title
   Send, % Title = &quot;Клик&quot; ? &quot;{Click, 100, 100}&quot; : &quot;{&quot; vk_code &quot;}&quot;
   return</code></pre></div><p>Обратите внимание на использование в определении горячей клавиши символа &quot;$&quot;, что предотвращает посыл клавишей самой себя.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 19 Dec 2013 11:39:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=78247#p78247</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=78238#p78238</link>
			<description><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>А где this_id присваивается значение?</p></blockquote></div><div class="codebox"><pre><code>CheckWin(active_id) -&gt; CheckWin(this_id)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Thu, 19 Dec 2013 08:43:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=78238#p78238</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=78237#p78237</link>
			<description><![CDATA[<p>А где this_id присваивается значение?</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 19 Dec 2013 08:25:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=78237#p78237</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=78236#p78236</link>
			<description><![CDATA[<p><strong>Задача:</strong><br />При нажатии на &quot;z&quot; если активное окно = нужное, то клик, иначе печатаем &quot;z&quot;.</p><p>Не получается печатать &quot;z&quot;.<br />Подскажите как исправить !</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"><div class="codebox"><pre><code>
Key = z

Hotkey, %Key%, Proc
Return

Proc:   
   WinGet, active_id, ID, A
   
   if CheckWin(active_id)           
      Click 100, 100 
   else
   {
      Send, %Key%
      sleep, 200
   }
Return

CheckWin(this_id)
{
   Res := false 
   
   sym = Текстовый        

   WinGetTitle, this_title, ahk_id %this_id%
    
   if (this_title &lt;&gt; &quot;&quot;) 
      IfInString, this_title, %sym%                  
         Res := true
        
   Return Res    
}
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Thu, 19 Dec 2013 06:57:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=78236#p78236</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73398#p73398</link>
			<description><![CDATA[<div class="quotebox"><cite>Ekklesiast пишет:</cite><blockquote><p><span class="bbu">почему AHK программисты всегда локально мыслят и привязываются насмерть к определённым окнам</span> ? )))))<br />&quot;Безымянный — Блокнот и.тп.&quot; - это временное окно для примера, а не константное</p></blockquote></div><p>Забавное рассуждение. То есть то, что вы запихнули строку &quot;Безымянный — Блокнот&quot; внутрь процедуры <em>CheckWindow</em>, автоматически делает ее переменной, а не постоянной? Я понимаю, что этот заголовок для образца, и его менять никто не запрещает.</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Mon, 01 Jul 2013 08:46:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73398#p73398</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73388#p73388</link>
			<description><![CDATA[<p><strong>Irbis</strong></p><div class="codebox"><pre><code>CheckWindow(this_id)
{    
    Res := false    
  
    WinGetTitle, this_title, ahk_id %this_id%    
   
    if (this_title &lt;&gt; &quot;&quot;)            
        if (this_title = &quot;Безымянный — Блокнот&quot;)                
            Res := true     
        
    return Res  
}</code></pre></div><p>у меня есть код (подобный выше описанному), по которому я определяю в какое окно посылать (эти окна могут иметь разный заголовок и.т.п)<br />и опять привязка к блокноту не канает</p><div class="codebox"><pre><code>WinGet, id, id, Безымянный — Блокнот</code></pre></div><p><span class="bbu">почему AHK программисты всегда локально мыслят и привязываются насмерть к определённым окнам</span> ? )))))<br />&quot;Безымянный — Блокнот и.тп.&quot; - это временное окно для примера, а не константное</p><br /><br /><p><strong>вроде так работает:</strong><br /></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"><div class="codebox"><pre><code>Key = ~z

Hotkey, %Key%, Proc
Return

Proc:
    if !id
    {
        WinGet, active_id, ID, A 
        if CheckWindow(active_id)
            if WinActive(&quot;ahk_id&quot; active_id)
                MsgBox, Hello, world!
    }
Return


CheckWindow(this_id)
{    
    Res := false    
  
    WinGetTitle, this_title, ahk_id %this_id%    
   
    if (this_title &lt;&gt; &quot;&quot;)            
        if (this_title = &quot;Безымянный — Блокнот&quot;)                
            Res := true     
        
    return Res  
}
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Mon, 01 Jul 2013 04:24:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73388#p73388</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73387#p73387</link>
			<description><![CDATA[<div class="quotebox"><cite>Ekklesiast пишет:</cite><blockquote><p>как сделать чтобы посылалось в нужное окно, а не по привязке ?</p></blockquote></div><p>Видимо, сия фраза имела какой-то иной, сакральный смысл, мной так и не понятый.</p><p>Что понимать под &quot;нужным&quot; окном, можно пояснить? И почему, когда мы таки определимся с &quot;нужным&quot; окном, &quot;привязывать&quot; действие к нему мы категорически не будем?</p><p>Если предположить, что требуется привязка к первому из найденных окон с нужным параметром (заголовок), и на остальные окна с таким заголовком скрипт не должен реагировать, тогда так:<br /></p><div class="codebox"><pre><code>Key = ~z

Hotkey, %Key%, Proc
Return

Proc:
   if !id
      WinGet, id, id, Безымянный — Блокнот
   if WinActive(&quot;ahk_id&quot; id)
      MsgBox, Hello, world!
Return

</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sun, 30 Jun 2013 22:16:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73387#p73387</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73380#p73380</link>
			<description><![CDATA[<p><strong>Irbis</strong>, а использовать тока одну кнопку &quot;z&quot; ни как ?</p><p>типа как-то так :<br /></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"><div class="codebox"><pre><code>Key = ~z

Hotkey, %Key%, Proc
Return

Proc:     
    if CheckTest()
        MsgBox, Hello, world!    
Return




CheckTest()
{    
    Res := false 
    
    WinGet, active_id, ID, A  
    WinGetTitle, this_title, ahk_id %this_id%    
   
    if (this_title &lt;&gt; &quot;&quot;)            
        if (this_title = &quot;Текстовый документ.txt&quot;)                
            Res := true  
        
    return Res 
}
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (Hydrogenium)]]></author>
			<pubDate>Sun, 30 Jun 2013 15:02:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73380#p73380</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как корректно задать переменный хоткей ?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73375#p73375</link>
			<description><![CDATA[<div class="codebox"><pre><code>Key = ~z

Hotkey, %Key%, Proc
Return

Proc:
    if WinActive(&quot;ahk_id&quot; active_id)
       MsgBox, Hello, world!
Return

F12:: WinGet, active_id, ID, A</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sun, 30 Jun 2013 05:43:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73375#p73375</guid>
		</item>
	</channel>
</rss>
