<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Активация \ дезактивация]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9813&amp;type=atom" />
	<updated>2014-08-09T08:17:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9813</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=85790#p85790" />
			<content type="html"><![CDATA[<p>Если речь идет про деактивацию/активацию назначенных клавиш (hotkeys) и автозамен (hotstrings), то я использую такой вариант с оформлением:</p><div class="codebox"><pre><code>; Pressing Win+A once will suspend hot keys of the script. Pressing it again will unsuspend.
#a::
Suspend  ; suspend/unsuspend AHK script IMPORTANT: must be first string after &quot;#a::&quot;, so &quot;#a::&quot; will not be suspended
if (A_IsSuspended==0) 
{
  Gui, Destroy
  Gui, font, s55 cGreen, Verdana ; font size
  Gui, Color, Red
  Gui +LastFound  ; Make the GUI window the last found window for use by the line below.
  WinSet, TransColor, Red
  Gui -Caption
  Gui, Add, Text,, ON
  Gui, Show
  Sleep, 500
  Gui, Destroy
  return
}
else
{
  Gui, Destroy
  Gui, font, s55 cRed, Verdana ; font size
  Gui, Color, Green
  Gui +LastFound  ; Make the GUI window the last found window for use by the line below.
  WinSet, TransColor, Green
  Gui -Caption
  Gui, Add, Text,, OFF
  Gui, Show
  Sleep, 500
  Gui, Destroy
  return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Li]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32459</uri>
			</author>
			<updated>2014-08-09T08:17:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=85790#p85790</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84896#p84896" />
			<content type="html"><![CDATA[<p>Вариант с переменной:<br /></p><div class="codebox"><pre><code>x := 0 ; устанавливает по умолчанию статус &quot;Не активно&quot;

Vk0x70::
if x != 0
{
x = 0
MsgBox, Не активно
Return
}

if x = 0
{
x = 1
MsgBox, Активно 
}
Return
</code></pre></div><p>В этой структуре удобнее редактировать фрагменты кода. Сам использую.</p>]]></content>
			<author>
				<name><![CDATA[Странникх]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30605</uri>
			</author>
			<updated>2014-07-19T02:04:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84896#p84896</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84895#p84895" />
			<content type="html"><![CDATA[<p>Лично в своих скриптах пользуюсь найденным на данном форуме вариантом старт-пауза на одну клавишу:<br /></p><div class="codebox"><pre><code>#MaxThreadsPerHotkey, 2

Vk51::
    If A_IsPaused
    {
        Pause, Off
        Return
    }
    Else
    {
        If Running
        {
            Pause, On
        }
        Else
        {
            Running := True
            остальная часть кода
        }
    }
Return</code></pre></div><p>Ну или так</p><div class="codebox"><pre><code>#MaxThreadsPerHotkey 2 
        
vk54::
    T := !T
    While T 
        ToolTip % A_TickCount  
    return</code></pre></div><p>если MaxThreadsPerHotkey мешает:</p><div class="codebox"><pre><code>vk54::
    T := !T 
    SetTimer, Loop, -1
    return

Loop:
    While T
        ToolTip % A_TickCount  
    return</code></pre></div><p>Вот еще один вариант!<br /></p><div class="codebox"><pre><code>Vk51::
off := 1
Loop
{
    Send, {vk54 down}{vk54 up}
    Random, Rand, 10, 1000
    sleep % Rand + 100

If off = 0
Break
}
return

Vk57::
off := 0
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Центурион]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32341</uri>
			</author>
			<updated>2014-07-18T19:03:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84895#p84895</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84866#p84866" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Всё равно непонятно. Речь о горячих клавишах, выполнении каких-то действий или другое?</p></blockquote></div><p>Именно, не так сформулировал</p>]]></content>
			<author>
				<name><![CDATA[Olega]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31900</uri>
			</author>
			<updated>2014-07-18T06:13:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84866#p84866</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84864#p84864" />
			<content type="html"><![CDATA[<p>Всё равно непонятно. Речь о горячих клавишах, выполнении каких-то действий или другое?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2014-07-18T05:14:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84864#p84864</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84863#p84863" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Что понимается под активацией и дезактивацией?</p></blockquote></div><p>Допустим есть скрипт... Тоесть мы делаем активацию &quot;F1::&quot;, ну и что бы дезактивация была на эту же &quot;F1&quot;.</p>]]></content>
			<author>
				<name><![CDATA[Olega]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31900</uri>
			</author>
			<updated>2014-07-18T05:08:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84863#p84863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84862#p84862" />
			<content type="html"><![CDATA[<p>Что понимается под активацией и дезактивацией?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2014-07-18T05:02:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84862#p84862</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Активация \ дезактивация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84861#p84861" />
			<content type="html"><![CDATA[<p>Как сделать активацию и дезактивацию на одну кнопку? Прошу прощение, наверно,&nbsp; глупый вопрос.</p>]]></content>
			<author>
				<name><![CDATA[Olega]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31900</uri>
			</author>
			<updated>2014-07-18T04:48:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84861#p84861</id>
		</entry>
</feed>
