<?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=7689&amp;type=atom" />
	<updated>2017-06-26T16:24:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7689</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=116871#p116871" />
			<content type="html"><![CDATA[<p>Остановить таймер после выполнения условия можно так:</p><div class="codebox"><pre><code>#Persistent
timer = 100
timeout = 60000
H = 1000

SetTimer, CheckTimeIdle, % timer
return

CheckTimeIdle:
H--
if (A_TimeIdlePhysical &gt; timeout)
MsgBox работает
    if H = 0
    SetTimer, CheckTimeIdle, off
return</code></pre></div><p>Дальше сами, используйте два таймера, например.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-06-26T16:24:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=116871#p116871</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=116866#p116866" />
			<content type="html"><![CDATA[<p>Подскажите, как по приведённому выше коду можно выполнить разные действия? Если таймаут выше 2 мин -выполнить <br /></p><div class="codebox"><pre><code>Process, Close, progB.exe
Run, progA.exe</code></pre></div><p> А, в случае если таймаут меньше 2 мин:<br /></p><div class="codebox"><pre><code>Process, Close, progA.exe
Run, progB.exe</code></pre></div><div class="codebox"><pre><code>
#Persistent
timer := 1000
timeout := 120000
SetTimer, CheckTimeIdle, % timer
return

CheckTimeIdle:
if (A_TimeIdlePhysical &gt;= timeout){
	ToolTip, stoim = %A_TimeIdlePhysical%
	Process, Close, progB.exe
    Run, progA.exe
} else {
	ToolTip, ne stoim = %A_TimeIdlePhysical%
	Process, Close, progA.exe
    Run, progB.exe
}
return</code></pre></div><p>Думал сделать через else, но выполняется условие каждую секнду из-за SetTimer и не как не могу придумать как заставить скрипт не запустить каждую итерацию мою программу.</p>]]></content>
			<author>
				<name><![CDATA[unKn0wn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27432</uri>
			</author>
			<updated>2017-06-25T20:05:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=116866#p116866</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80612#p80612" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Hydrogenium пишет:</cite><blockquote><p><span class="bbu">AHK: Как определить движение мыши и любой клик клавиатуры ?</span></p><p>Есть ли простой код для этого ?</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2014-03-09T07:02:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80612#p80612</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64705#p64705" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>&#91;CM]White пишет:</cite><blockquote><p>Хотелось бы увидеть на примере моего кода <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p></blockquote></div><p>Хотелось бы увидеть ваши варианты решения, использующие A_TimeIdlePhysical <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><div class="codebox"><pre><code>#Persistent
timer := 1000
timeout := 120000
SetTimer, CheckTimeIdle, % timer
return

CheckTimeIdle:
    if (A_TimeIdlePhysical &gt;= timeout &amp;&amp; Mod(A_TimeIdlePhysical, timeout) &lt; timer)
        MsgBox Простаиваем очередные 2 минуты
    return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-10-11T10:53:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64705#p64705</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64704#p64704" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>Код подразумевает запуск функции каждые 2 минуты неактивности пользователя.<br />Есть соответствующая встроенная переменная A_TimeIdlePhysical. значения равное 120000 равнозначно двум минутам простоя.</p></blockquote></div><p>Хотелось бы увидеть на примере моего кода <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[[CM]White]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28415</uri>
			</author>
			<updated>2012-10-11T10:49:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64704#p64704</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64703#p64703" />
			<content type="html"><![CDATA[<p>Код подразумевает запуск функции каждые 2 минуты неактивности пользователя.<br />Есть соответствующая встроенная переменная A_TimeIdlePhysical. значения равное 120000 равнозначно двум минутам простоя.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-10-11T10:38:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64703#p64703</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:Проверка на активность клавиатуры\мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64700#p64700" />
			<content type="html"><![CDATA[<p>Доброго времени суток <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>CoordMode, Mouse, Screen
    SetTimer, MouseWatch, 1000
MouseWatch:
    MouseGetPos, x, y
    if (x = x_old) &amp;&amp; (y = y_old)
         counter++
    else counter =
    if counter = 120
    IfWinExist GTA:SA:MP
         MyFunc(), counter := 0
    x_old := x, y_old := y
    return
    
  
MyFunc()
пошел процесс</code></pre></div><p>к проверке на активность мыши нужно добавить и проверку на активность клавиатуры, с чем и возникли проблемы</p>]]></content>
			<author>
				<name><![CDATA[[CM]White]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28415</uri>
			</author>
			<updated>2012-10-11T10:06:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64700#p64700</id>
		</entry>
</feed>
