<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=4570&amp;type=atom" />
	<updated>2010-06-08T15:11:35Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=4570</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36444#p36444" />
			<content type="html"><![CDATA[<p>Класс. То, что надо.</p>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2010-06-08T15:11:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36444#p36444</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36435#p36435" />
			<content type="html"><![CDATA[<p>Для Коллекции, думаю, интереснее будет не конкретно эта тема, а вообще использование хуков в AHK при помощи функции <a href="http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx">SetWindowsHookEx</a> (которое я, честно говоря, подсмотрел где-то на оф. форуме). Здесь вся фишка в том, что несмотря на<br /></p><div class="quotebox"><blockquote><p><strong>MSDN</strong>, <strong><a href="http://msdn.microsoft.com/en-us/library/ms644960%28VS.85%29.aspx">Using Hooks:</a></strong><br />You must place a global hook procedure in a DLL separate from the application installing the hook procedure.</p></blockquote></div><p>по-крайней мере функции <a href="http://msdn.microsoft.com/en-us/library/ms644986%28VS.85%29.aspx">LowLevelMouseProc</a> и <a href="http://msdn.microsoft.com/en-us/library/ms644985%28VS.85%29.aspx">LowLevelKeyboardProc</a> работают, даже будучи размещёнными в теле самого скрипта.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2010-06-08T12:39:55Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36435#p36435</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36434#p36434" />
			<content type="html"><![CDATA[<p>Не забываем про Коллекцию <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" />.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2010-06-08T12:10:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36434#p36434</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36433#p36433" />
			<content type="html"><![CDATA[<p>Легко! Любой каприз за ваши деньги! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2010-06-08T12:04:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36433#p36433</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36432#p36432" />
			<content type="html"><![CDATA[<p>Крутота! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> <strong>teadrinker</strong>, готовься, сейчас запросят диагональные линии, круги, синусоиды и проч. <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2010-06-08T12:03:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36432#p36432</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36431#p36431" />
			<content type="html"><![CDATA[<p>Вот скрипт, в котором события, генерируемые мышью, пропускаются через <a href="http://msdn.microsoft.com/en-us/library/ms644986%28VS.85%29.aspx">мышиный</a> <a href="http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx">хук</a>. Его функция изменяет движение курсора, если нажата <em>LCtrl</em> — на горизонтальное, если <em>LShift</em> — на вертикальное.<br /></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

~LCtrl::
   MouseGetPos,, y_prev
   Direction = horizontal
   Return

~LShift::
   MouseGetPos, x_prev
   Direction = vertical
   Return

~LCtrl Up::   Direction =
~LShift Up:: Direction =

LowLevelMouseProc(nCode, wParam, lParam)
{
   global Direction, x_prev, y_prev

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

   if Direction = horizontal
      x := NumGet(lParam+0), y := y_prev

   if Direction = vertical
      y := NumGet(lParam+0, 4), x := x_prev

   MouseMove, x, y, 0
   Return 1
}</code></pre></div><p>Не исключаю, что этот приём может иногда нарушать корректность работы мыши, так что используй на свой страх и риск.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2010-06-08T11:41:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36431#p36431</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36424#p36424" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>evgenyatam пишет:</cite><blockquote><p>зачем писать? есть сдесь: <a href="http://www.donationcoder.com/Software/Skrommel/">http://www.donationcoder.com/Software/Skrommel/</a></p></blockquote></div><p>Какое из этих приложений использовать для ортогонального перемещения выши?</p>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2010-06-08T08:14:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36424#p36424</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36421#p36421" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>З</strong></span>ачем писать? <span style="color: green"><strong>Е</strong></span>сть <span style="color: green"><strong>з</strong></span>десь: <a href="http://www.donationcoder.com/Software/Skrommel/">1 Hour Software by Skrommel - DonationCoder.com</a>.</p>]]></content>
			<author>
				<name><![CDATA[evgenyatam]]></name>
			</author>
			<updated>2010-06-08T07:13:06Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36421#p36421</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36413#p36413" />
			<content type="html"><![CDATA[<p>Можно, попозже напишу.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2010-06-07T20:09:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36413#p36413</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36412#p36412" />
			<content type="html"><![CDATA[<p>Я наверное не совсем точно выразил мысль. Зажимаем шифт, двигаем мышь по коврику вправо, а на экране курсор двигается вправо строго по прямой линии.<br />Не знаю как с этим параметром R осуществить такое.</p>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2010-06-07T20:05:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36412#p36412</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36411#p36411" />
			<content type="html"><![CDATA[<p>А в чём проблема? <a href="http://www.script-coding.com/AutoHotkey/MouseMove.html">MouseMove</a> с параметром <strong>R</strong>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2010-06-07T19:48:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36411#p36411</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Ортогональное перемещение мыши]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=36410#p36410" />
			<content type="html"><![CDATA[<p>Реально ли написать такое, что бы, например, при зажатии shift, мышь двигалась ортогонально, т.е. строго вертикально, или строго горизонтально?</p>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2010-06-07T18:44:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=36410#p36410</id>
		</entry>
</feed>
