<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: MouseMove -> Wheel]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6593</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6593&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: MouseMove -> Wheel».]]></description>
		<lastBuildDate>Tue, 27 Dec 2011 11:33:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: MouseMove -> Wheel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=55019#p55019</link>
			<description><![CDATA[<p>Постраничное перелистывание: 1 движение мышью (в целом) - одноперелистывание<br /></p><div class="codebox"><pre><code>SetBatchLines, -1
;SetKeyDelay, 175
OnExit, Exit
hHook:=DllCall(&quot;SetWindowsHookEx&quot;, &quot;Int&quot;, 0xE ; WH_MOUSE_LL
     , &quot;Int&quot;, RegisterCallback(&quot;LowLevelMouseProc&quot;, &quot;Fast&quot;)
     , &quot;UInt&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;UInt&quot;, 0)
     , &quot;UInt&quot;, 0)
Return
 
Esc::ExitApp
SC127::zzz:=!zzz, y_prev:=&quot;&quot;, PrevTime:=0

Exit:
   DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;UInt&quot;, hHook)
   ExitApp
 
LowLevelMouseProc(nCode, wParam, lParam)
{
   global

   If (nCode&lt;0 || wParam!=0x200) ; WM_MOUSEMOVE
      Return, DllCall(&quot;CallNextHookEx&quot;, &quot;UInt&quot;, 0
                                      , &quot;Int&quot;, nCode
                                      , &quot;UInt&quot;, wParam
                                      , &quot;UInt&quot;, lParam)
   Else If zzz
   {
     Time := NumGet(lParam+0, 16)
     ;InactivityTime := Time - PrevTime
     y:=NumGet(lParam+4) , y_prev:=y_prev=&quot;&quot; ? y:y_prev
     if Time - PrevTime &gt; 600
     {
       If (y&gt;y_prev)
         Send, {PgUp}
         ;Click, WU
       Else If (y&lt;y_prev)
         Send, {PgDn}
         ;Click, WD
       PrevTime := Time
     }
     Return, 1
   }
   Else
      Return, DllCall(&quot;CallNextHookEx&quot;, &quot;UInt&quot;, 0
                                      , &quot;Int&quot;, nCode
                                      , &quot;UInt&quot;, wParam
                                      , &quot;UInt&quot;, lParam)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (xGen)]]></author>
			<pubDate>Tue, 27 Dec 2011 11:33:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=55019#p55019</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: MouseMove -> Wheel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54992#p54992</link>
			<description><![CDATA[<div class="quotebox"><cite>xGen пишет:</cite><blockquote><p>От таймера я отказался из-за по-дергивания.</p></blockquote></div><p>Без таймера присутствует эффект <em>кинетики</em> и ещё заметил, что если клавишу-переключатель нажать когда курсор в движении, то дальнейшие действия происходят не по сценарию. </p><div class="codebox"><pre><code>...
   If (y&gt;y_prev)
      Send, {Down}
;      Click, WD
   Else If (y&lt;y_prev)
      Send, {Up}
;      Click, WU
...</code></pre></div><p><strong>Else If</strong> вместо просто <strong>Else</strong> в данном случае убирает <em>подёргивания</em> при медленном движении мышью.</p>]]></description>
			<author><![CDATA[null@example.com (Grey)]]></author>
			<pubDate>Tue, 27 Dec 2011 00:04:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54992#p54992</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: MouseMove -> Wheel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54988#p54988</link>
			<description><![CDATA[<p>Огромное спасибо за помощь.</p><p>...но пришлось немного изменить скрипт, т.к., по не понятным для меня причинам, при серии движение-остановка мышью страница продолжала двигаться дальше и остановить ее не представлялось возможным.<br />От таймера я отказался из-за по-дергивания. Использовать Click, WD - не возможно - (иногда) происходит слишком быстрое перемещение страницы<br /></p><div class="codebox"><pre><code>
SetBatchLines, -1
;SetKeyDelay, 175
OnExit, Exit
hHook:=DllCall(&quot;SetWindowsHookEx&quot;, &quot;Int&quot;, 0xE ; WH_MOUSE_LL
     , &quot;Int&quot;, RegisterCallback(&quot;LowLevelMouseProc&quot;, &quot;Fast&quot;)
     , &quot;UInt&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;UInt&quot;, 0)
     , &quot;UInt&quot;, 0)
Return
 
Esc::ExitApp
SC127::zzz:=!zzz, y_prev:=&quot;&quot;

Exit:
   DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;UInt&quot;, hHook)
   ExitApp
 
LowLevelMouseProc(nCode, wParam, lParam)
{
   global
   If (nCode&lt;0 || wParam!=0x200) ; WM_MOUSEMOVE
      Return, DllCall(&quot;CallNextHookEx&quot;, &quot;UInt&quot;, 0
                                      , &quot;Int&quot;, nCode
                                      , &quot;UInt&quot;, wParam
                                      , &quot;UInt&quot;, lParam)
   Else If zzz
   {
      y:=NumGet(lParam+4) , y_prev:=y_prev=&quot;&quot; ? y:y_prev

      If (y&gt;y_prev)
        Send, {Up}
        ;Click, WU
      Else If (y&lt;y_prev)
        Send, {Down}
        ;Click, WD

      Return, 1
   }
   Else
      Return, DllCall(&quot;CallNextHookEx&quot;, &quot;UInt&quot;, 0
                                      , &quot;Int&quot;, nCode
                                      , &quot;UInt&quot;, wParam
                                      , &quot;UInt&quot;, lParam)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (xGen)]]></author>
			<pubDate>Mon, 26 Dec 2011 19:38:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54988#p54988</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: MouseMove -> Wheel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54982#p54982</link>
			<description><![CDATA[<div class="codebox"><pre><code>SetBatchLines, -1
SetKeyDelay, 175
OnExit, Exit
hHook:=DllCall(&quot;SetWindowsHookEx&quot;, &quot;Int&quot;, 0xE ; WH_MOUSE_LL
     , &quot;Int&quot;, RegisterCallback(&quot;LowLevelMouseProc&quot;, &quot;Fast&quot;)
     , &quot;UInt&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;UInt&quot;, 0)
     , &quot;UInt&quot;, 0)
Return

Esc::ExitApp
Space::zzz:=!zzz, y_prev:=&quot;&quot;

Label:
   If (y&gt;y_prev)
      Send, {Down}
;      Click, WD
   Else If (y&lt;y_prev)
      Send, {Up}
;      Click, WU
   Return

Exit:
   DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;UInt&quot;, hHook)
   ExitApp

LowLevelMouseProc(nCode, wParam, lParam)
{
   global
   If (nCode&lt;0 || wParam!=0x200) ; WM_MOUSEMOVE
      Return, DllCall(&quot;CallNextHookEx&quot;, &quot;UInt&quot;, 0
                                      , &quot;Int&quot;, nCode
                                      , &quot;UInt&quot;, wParam
                                      , &quot;UInt&quot;, lParam)
   Else If zzz
   {
      y:=NumGet(lParam+4) , y_prev:=y_prev=&quot;&quot; ? y:y_prev
      SetTimer, Label, -0
      Return, 1
   }
   Else
      Return, DllCall(&quot;CallNextHookEx&quot;, &quot;UInt&quot;, 0
                                      , &quot;Int&quot;, nCode
                                      , &quot;UInt&quot;, wParam
                                      , &quot;UInt&quot;, lParam)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Grey)]]></author>
			<pubDate>Mon, 26 Dec 2011 15:39:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54982#p54982</guid>
		</item>
		<item>
			<title><![CDATA[AHK: MouseMove -> Wheel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54935#p54935</link>
			<description><![CDATA[<p>Являюсь обладателем планшета под Win7 со встроенной оптической мышкой в виде квадратного окошка <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> по которому нужно проводить пальцем (оптический трек).</p><p>Имеется желание использовать эту мышь в двух режимах:<br />1. обычная мышь<br />2. колесо прокрутки мыши (или клавиатурные UP DOWN)<br />Режим меняется определенной клавишей.</p><p>Код набросал, но есть баги:<br />1. Иногда вообще не двигается с места<br />2. двигается как нервная, т.е. не хватает плавности</p><div class="codebox"><pre><code>   SetBatchLines, -1
   SetMouseDelay, -1
   CoordMode, Mouse
   OnExit, Exit

   hHook := 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, hHook)
   ExitApp
   
Esc:: ExitApp

SC127::
zzz := zzz ? 0 : 1
y_prev := &quot;&quot;
return

LowLevelMouseProc(nCode, wParam, lParam)
{
   global zzz
   global y_prev ;static y_prev

   if (nCode &lt; 0 || wParam != 0x200)   ; WM_MOUSEMOVE = 0x200
      Return DllCall(&quot;CallNextHookEx&quot;, UInt, 0, Int, nCode, UInt, wParam, UInt, lParam)

   y := NumGet(lParam+0, 4)
   
   y_prev := y_prev = &quot;&quot; ? y : y_prev

   if (zzz = 1)
   {   
	if (y &gt; y_prev)
	{
		Send {Up}
	}
	Else
		Send {Down}
	Return 1
   }
   else Return DllCall(&quot;CallNextHookEx&quot;, UInt, 0, Int, nCode, UInt, wParam, UInt, lParam)
}</code></pre></div><p>Прошу помощи в доработке скрипта.<br />Не въеду как добавить плавности, посему click WheelUp не использовал</p>]]></description>
			<author><![CDATA[null@example.com (xGen)]]></author>
			<pubDate>Sat, 24 Dec 2011 14:04:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54935#p54935</guid>
		</item>
	</channel>
</rss>
