<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8081&amp;type=atom" />
	<updated>2013-02-14T19:52:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8081</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69506#p69506" />
			<content type="html"><![CDATA[<p><strong>Irbis</strong> ещё удобно тем что если надо выполнять только по факту нажатия<br /></p><div class="codebox"><pre><code>KeyWait, % A_ThisHotkey</code></pre></div><p>то не нужно вписывать в каждую метку:<br /></p><div class="codebox"><pre><code>Home::
   a := (!a || a = 3) ? 1 : a+1
   Gosub Home%a%
   KeyWait, % A_ThisHotkey
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-14T19:52:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69506#p69506</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69504#p69504" />
			<content type="html"><![CDATA[<p>Как вариант-2<br />Количество различных действий определяет выражение a = 3, и соответственно такое же кол-во процедур HomeN должно присутствовать.</p><div class="codebox"><pre><code>Home:: Gosub % &quot;Home&quot; a := (!a || a = 3) ? 1 : a+1

Home1:
   MsgBox, 262144, % A_LineNumber, % &quot;some code&quot;, % .5
      ; ...
Return
Home2:
      MsgBox, 262144, % A_LineNumber, % &quot;some other code 2&quot;, % .5
      ; ...
Return
Home3:
      MsgBox, 262144, % A_LineNumber, % &quot;some other code 3&quot;, % .5
      ; ...
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2013-02-14T19:38:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69504#p69504</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69496#p69496" />
			<content type="html"><![CDATA[<p>Как вариант:</p><div class="codebox"><pre><code>Home::
   If !a
   {
      a:=1
      MsgBox, 262144, % A_LineNumber, % &quot;some code&quot;, % .5
      ; ...
   }
   Else If a=1
   {
      a:=2
      MsgBox, 262144, % A_LineNumber, % &quot;some other code 2&quot;, % .5
      ; ...
   }
   Else
   {
      a:=&quot;&quot;
      MsgBox, 262144, % A_LineNumber, % &quot;some other code 3&quot;, % .5
      ; ...
   }
;    KeyWait, % A_ThisHotkey
   Return</code></pre></div><p>Не забываем об отступах, ибо читать не удобно.</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2013-02-14T17:59:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69496#p69496</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69493#p69493" />
			<content type="html"><![CDATA[<p>А на 3 как лучше?<br /></p><div class="codebox"><pre><code>
home::
if !a
{ a = 1
tooltip 1 последовательность
return 
} if a = 1
{ a = 2
tooltip 2 последовательность
return  
} else a =
tooltip 3 последовательность
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-14T17:27:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69493#p69493</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69492#p69492" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Home::
   If a:=!a
   {
      MsgBox, 262144, % A_LineNumber, % &quot;some code&quot;, % .5
      ; ...
   }
   Else
   {
      MsgBox, 262144, % A_LineNumber, % &quot;some other code&quot;, % .5
      ; ...
   }
;    KeyWait, % A_ThisHotkey
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2013-02-14T17:27:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69492#p69492</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69490#p69490" />
			<content type="html"><![CDATA[<p>Пожалуйста.<br />Немного упростил код.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-14T17:03:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69490#p69490</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69488#p69488" />
			<content type="html"><![CDATA[<p>Спасибо большое!</p>]]></content>
			<author>
				<name><![CDATA[bychkov1609]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29579</uri>
			</author>
			<updated>2013-02-14T16:49:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69488#p69488</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69487#p69487" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
home:: 
if !a
{ a = 1
MsgBox 1 последовательность
return 
} a =
MsgBox 2 последовательность
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-14T16:39:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69487#p69487</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:Скрипт на 2 действие при повторном нажатии уже забинденой клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69485#p69485" />
			<content type="html"><![CDATA[<p>Уважаемые форумчане, написал скрипт с необходимым содержанием:<br /></p><div class="codebox"><pre><code>home:: 
send, {WheelDown}
sleep, 1
send, {ENTER}
sleep, 1200
send, {WheelDown}
sleep, 100
send, {WheelDown}
sleep, 100
send, {WheelDown}
sleep, 100
send, {WheelDown}
sleep, 100
send, {ENTER}
sleep, 100</code></pre></div><p>Хочу дополнить его еще одной последовательностью действий причем по нажатию той же клавиши &quot;home&quot;. т.е: нажал один раз выполнилось вышеприведенная последовательность, нажал второй раз- другая похожая последовательность. Как это сделать? Заранее благодарен.</p>]]></content>
			<author>
				<name><![CDATA[bychkov1609]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29579</uri>
			</author>
			<updated>2013-02-14T16:12:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69485#p69485</id>
		</entry>
</feed>
