<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; JScript: имитация движений мыши и отслеживание нажатия клавиш]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=636</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=636&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «JScript: имитация движений мыши и отслеживание нажатия клавиш».]]></description>
		<lastBuildDate>Tue, 28 Aug 2007 17:32:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[JScript: имитация движений мыши и отслеживание нажатия клавиш]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=4313#p4313</link>
			<description><![CDATA[<p>Автор примера - <strong>YMP</strong>.<br />Пример демонстрирует имитацию движений мыши и отслеживание нажатия левого Shift, которое приводит к остановке (завершению) скрипта. Потребуется библиотека <a href="http://www.script-coding.com/dynwrap.html">dynwrap.dll</a>.<br /></p><div class="codebox"><pre><code>LShift=0xA0;    // Код виртуальной клавиши для левого Shift.
ws=WScript;
wrap=ws.CreateObject(&quot;DynamicWrapper&quot;);
wrap.Register(&quot;user32.dll&quot;, &quot;mouse_event&quot;, &quot;i=uuuuu&quot;, &quot;f=s&quot;);
wrap.Register(&quot;user32.dll&quot;, &quot;GetAsyncKeyState&quot;, &quot;i=l&quot;, &quot;f=s&quot;, &quot;r=t&quot;);
while(true) {
  wrap.mouse_event(1, 10, 0, 0, 0);         // 10 пикселов вправо.
  ws.Sleep(1000);
  if(wrap.GetAsyncKeyState(LShift)) break;  // Проверка, было ли нажатие.
  wrap.mouse_event(1, -10, 0, 0, 0);       // Влево.
  ws.Sleep(1000);
  if(wrap.GetAsyncKeyState(LShift)) break;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (The gray Cardinal)]]></author>
			<pubDate>Tue, 28 Aug 2007 17:32:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=4313#p4313</guid>
		</item>
	</channel>
</rss>
