<?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=10907</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10907&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Задание условия на нажатие клавиши».]]></description>
		<lastBuildDate>Tue, 06 Mar 2018 09:33:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123949#p123949</link>
			<description><![CDATA[<p>Директивы выделяются символом #.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 06 Mar 2018 09:33:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123949#p123949</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123941#p123941</link>
			<description><![CDATA[<p><strong>Malcev</strong>, какие параметры данного скрипта являются директивами?</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Mon, 05 Mar 2018 21:44:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123941#p123941</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123884#p123884</link>
			<description><![CDATA[<p>За компьютером буду нескоро. Можете попробовать вынести из функции переменную count в начало скрипта и обьявить ее глобальной. Ну и директивы тоже вынести.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 02 Mar 2018 19:36:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123884#p123884</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123883#p123883</link>
			<description><![CDATA[<p><strong>Malcev</strong>, он, по всей видимости, работает без учета нюансов, которые были описаны позже. Последний вариант невозможно заключить в ф-ию?</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Fri, 02 Mar 2018 19:16:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123883#p123883</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123882#p123882</link>
			<description><![CDATA[<p>Используйте за основу код из 60 поста.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 02 Mar 2018 19:11:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123882#p123882</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123880#p123880</link>
			<description><![CDATA[<p><strong>Malcev</strong>, хочу назначить мультинажатие на множество клавиш, дабы не копировать многократно основную массу кода.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Fri, 02 Mar 2018 07:22:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123880#p123880</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123878#p123878</link>
			<description><![CDATA[<p>Не подскажу, так как не понимаю, что вы хотите добиться и чем вас не устраивает вариант без функции.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 01 Mar 2018 23:42:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123878#p123878</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123877#p123877</link>
			<description><![CDATA[<p><strong>Malcev</strong>, подскажите, пожалуйста, как добавить последний вариант в ф-ию? Ниже нерабочая попытка.<br /></p><div class="codebox"><pre><code>#SingleInstance Force

f2:: 
MultikeyReset(&quot;{vk4B}&quot;, &quot;{vk44}+{5}+{9}+{3}&quot;, &quot;{vk58}^+{vk41}&quot;)
return

MultikeyReset(arr1, arr2, arr3){
#InstallKeybdHook
#InstallMouseHook
   count := 0
arr:=[arr1, arr2, arr3]
If (A_PriorKey != A_ThisHotkey)
   count := 0
array := arr[Count := Count*((A_PriorHotkey = A_ThisHotkey))+1]
loop, parse, array, `,
{
   SendInput % A_LoopField
   sleep 200
}
if (count  = arr.Length())
{
   count := 0
   KeyWait % A_ThisHotkey
   return
}
}
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Thu, 01 Mar 2018 21:02:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123877#p123877</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=105267#p105267</link>
			<description><![CDATA[<p><strong>Malcev</strong>, спасибо, работает!<br /></p><div class="quotebox"><blockquote><p>А зачем нужна эта строчка?</p></blockquote></div><p>К сожалению, не знаю.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Wed, 15 Jun 2016 22:15:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=105267#p105267</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=104915#p104915</link>
			<description><![CDATA[<div class="codebox"><pre><code>#SingleInstance Force
#InstallKeybdHook
#InstallMouseHook
Count := 0
f1::
arr:=[&quot;1,1_1,1_2&quot;, &quot;2,2_1&quot;, &quot;3&quot;]
If (A_PriorKey != A_ThisHotkey)
   count := 0
array := arr[Count := Count*((A_PriorHotkey = A_ThisHotkey))+1]
loop, parse, array, `,
{
   gosub % A_LoopField
   sleep 200
}
if (count  = arr.Length())
{
   count := 0
   KeyWait % A_ThisHotkey
   return
}
return

1:
ToolTip % a_thislabel
return
1_1:
ToolTip % a_thislabel
return
1_2:
ToolTip % a_thislabel
return
2:
ToolTip % a_thislabel
return
2_1:
ToolTip % a_thislabel
return
3:
ToolTip % a_thislabel
return</code></pre></div><p>А зачем нужна эта строчка?<br /></p><div class="codebox"><pre><code>if (A_TimeSincePriorHotkey &lt; 50) and (A_TimeSincePriorHotkey != -1) and (count = arr.Length())
   return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Jun 2016 20:27:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=104915#p104915</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=104895#p104895</link>
			<description><![CDATA[<p><strong>Malcev</strong>, спасибо! Только при зажатии клавиши метки проверяются циклично. Необходимо остановится на последней, т.е. в данном случае, на метке &quot;3&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Tue, 07 Jun 2016 18:34:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=104895#p104895</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=104886#p104886</link>
			<description><![CDATA[<p>Если брать за основу код из 69 поста, то можно так:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#InstallKeybdHook
#InstallMouseHook
Count := 0
f1::
arr:=[&quot;1,1_1,1_2&quot;, &quot;2,2_1&quot;, &quot;3&quot;]
if (A_TimeSincePriorHotkey &lt; 50) and (A_TimeSincePriorHotkey != -1) and (count = arr.Length())
   return
If (A_PriorKey != A_ThisHotkey) or (count = arr.Length())
   count := 0
array := arr[Count := Count*((A_PriorHotkey = A_ThisHotkey))+1]
loop, parse, array, `,
{
   gosub % A_LoopField
   sleep 500
}
return

1:
ToolTip % a_thislabel
return
1_1:
ToolTip % a_thislabel
return
1_2:
ToolTip % a_thislabel
return
2:
ToolTip % a_thislabel
return
2_1:
ToolTip % a_thislabel
return
3:
ToolTip % a_thislabel
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Jun 2016 15:52:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=104886#p104886</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=104885#p104885</link>
			<description><![CDATA[<p><strong>Malcev</strong>, в приведенном варианте каждое нажатие горячей клавиши переходит к определенной (одной) метке. Необходима возможность устанавливать неограниченное кол-во меток на каждое нажатие. При этом, по-прежнему, при зажатии горячей клавиши, сценарий должен пройти поочередно все метки и остановиться на последней.</p><p>Gosub не подходит, т.к. в моем случае будет множество дублирований практически одного и того же. Т.к. для каждой мультизадачной горячей клавиши будет необходимо создавать уникальные метки. Хотелось бы, чтобы метки универсально использовались для разных горячих клавиш.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Tue, 07 Jun 2016 15:22:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=104885#p104885</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=104883#p104883</link>
			<description><![CDATA[<p>Мне лично ничего не понятно.<br />Почему не подходит GoSub?</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Jun 2016 14:47:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=104883#p104883</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Задание условия на нажатие клавиши]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=104857#p104857</link>
			<description><![CDATA[<p>Подскажите, пожалуйста, как, например, ко второму нажатию горячей клавиши добавить выполнение метки &quot;4&quot;, следом за меткой &quot;2&quot;?<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#InstallKeybdHook
#InstallMouseHook
1::
arr:=[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
if (A_TimeSincePriorHotkey &lt; 50) and (A_TimeSincePriorHotkey != -1) and (count = arr.Length())
   return
If (A_PriorKey != A_ThisHotkey) or (count = arr.Length())
   count := 0
gosub % arr[Count := Count*((A_PriorHotkey = A_ThisHotkey))+1]
return

1:
2:
3:
ToolTip % a_thislabel
return

4:
MsgBox % a_thislabel
return</code></pre></div><p>Такой вариант не подходит:<br /></p><div class="codebox"><pre><code>2:
gosub 4
ToolTip % a_thislabel
return</code></pre></div><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Для чего это нужно:</div><div class="fancy_spoiler"><p>В следующем примере в результате зажатия горячей клавиши, как и задумывалось, выполнение сценария останавливается на последней метке:<br /></p><div class="codebox"><pre><code>1::
arr:= [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
if (A_TimeSincePriorHotkey &lt; 50) and (A_TimeSincePriorHotkey != -1) and (count = arr.Length())
   return
If (A_PriorKey != A_ThisHotkey) or (count = arr.Length())
   count := 0
gosub % arr[Count := Count*((A_PriorHotkey = A_ThisHotkey))+1]
return

1:
2:
3:
ToolTip % a_thislabel
return</code></pre></div><p>А так в результате зажатия метки выполняются по кругу (где метка &quot;Analyze&quot; должна выполняться на ряду с меткой &quot;1&quot;):<br /></p><div class="codebox"><pre><code>1::
arr:= [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
if (A_TimeSincePriorHotkey &lt; 50) and (A_TimeSincePriorHotkey != -1) and (count = arr.Length())
   return
If (A_PriorKey != A_ThisHotkey) or (count = arr.Length())
   count := 0
gosub % arr[Count := Count*((A_PriorHotkey = A_ThisHotkey))+1]
gosub Analyze
return

1:
2:
3:
ToolTip % a_thislabel
return

Analyze:
MouseGetPos, FXClipX, FXClipY
ImageSearch, AnalyzeX, AnalyzeY, 0, 0, A_ScreenWidth, A_ScreenHeight, %A_ScriptDir%\Analyze.png
If ErrorLevel = 0
	MouseClick, , %AnalyzeX%, %AnalyzeY%, 1 ,0.5
MouseMove, %FXClipX%, %FXClipY%, 0.5
return</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Mon, 06 Jun 2016 19:21:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=104857#p104857</guid>
		</item>
	</channel>
</rss>
