<?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>http://forum.script-coding.com/viewtopic.php?id=2789</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=2789&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Отслеживание времени бездействия мыши».]]></description>
		<lastBuildDate>Mon, 30 Apr 2012 17:59:24 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Отслеживание времени бездействия мыши]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59853#p59853</link>
			<description><![CDATA[<p>Вариант, поддерживающий AHK_L x64.<br /></p><div class="codebox"><pre><code>   PrevTime := A_TickCount
   OnExit, Exit
   hHookMouse := DllCall(&quot;SetWindowsHookEx&quot; . (A_IsUnicode ? &quot;W&quot; : &quot;A&quot;)
      , Int, WH_MOUSE_LL := 14
      , Int, RegisterCallback(&quot;LowLevelMouseProc&quot;, &quot;Fast&quot;)
      , Ptr, DllCall(&quot;GetModuleHandle&quot;, UInt, 0, Ptr)
      , UInt, 0, Ptr)
   Return
 
Exit:
   DllCall(&quot;UnhookWindowsHookEx&quot;, UInt, hHookMouse)
   ExitApp
 
LowLevelMouseProc(nCode, wParam, lParam)
{
   global PrevTime
   Time := NumGet(lParam+0, 16, &quot;UInt&quot;)
   InactivityTime := Time - PrevTime
   if InactivityTime &gt; 300
   {
      ToolTip % &quot;Время бездействия мыши &quot; InactivityTime &quot; ms&quot;
      PrevTime := Time
   }
   Return DllCall(&quot;CallNextHookEx&quot;, Ptr, 0, Int, nCode, UInt, wParam, UInt, lParam)
}
 
Esc::ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 30 Apr 2012 17:59:24 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59853#p59853</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Отслеживание времени бездействия мыши]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=52805#p52805</link>
			<description><![CDATA[<p>Вариант с использованием <a href="http://forum.script-coding.com/viewtopic.php?id=6350">хука</a> на события мыши:<br /></p><div class="codebox"><pre><code>   PrevTime := A_TickCount
   OnExit, Exit
   hHookKeybd := DllCall(&quot;SetWindowsHookEx&quot;
      , Int, WH_MOUSE_LL := 14
      , Int, RegisterCallback(&quot;LowLevelMouseProc&quot;, &quot;Fast&quot;)
      , UInt, DllCall(&quot;GetModuleHandle&quot;, UInt, 0)
      , UInt, 0)
   Return
 
Exit:
   DllCall(&quot;UnhookWindowsHookEx&quot;, Uint, hHookKeybd)
   ExitApp
 
LowLevelMouseProc(nCode, wParam, lParam)
{
   global PrevTime
   Time := NumGet(lParam+0, 16)
   InactivityTime := Time - PrevTime
   if InactivityTime &gt; 300
   {
      ToolTip % &quot;Время бездействия мыши &quot; InactivityTime &quot; ms&quot;
      PrevTime := Time
   }
   Return DllCall(&quot;CallNextHookEx&quot;, UInt, 0, Int, nCode, UInt, wParam, UInt, lParam)
}
 
Esc::ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 22 Oct 2011 20:09:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=52805#p52805</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Отслеживание времени бездействия мыши]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=19534#p19534</link>
			<description><![CDATA[<p>Скрипт выполняет нужную функцию по прошествии определённого времени неактивности мыши.</p><div class="codebox"><pre><code>    CoordMode, Mouse, Screen
    SetTimer, MouseWatch, 1000
    return

MouseWatch:
    MouseGetPos, x, y
    if (x = x_old) &amp;&amp; (y = y_old)
         counter++
    else counter =
    if counter = 5
         MyFunc(), counter := 0
    x_old := x, y_old := y
    return
    
~WheelDown::
~WheelUp::
~RButton::
~LButton::
    counter =
    return
    
MyFunc()
{
    MsgBox, 5 секунд бездействия мыши!
}

Esc:: ExitApp</code></pre></div><p>Авторы скрипта <strong>teadrinker</strong> и <strong>YMP</strong></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 15 Feb 2009 17:17:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=19534#p19534</guid>
		</item>
	</channel>
</rss>
