<?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=15218</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=15218&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Нажатие левой кнопки мыши - действие, нажатие правой отмена».]]></description>
		<lastBuildDate>Tue, 03 Mar 2020 19:56:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Нажатие левой кнопки мыши - действие, нажатие правой отмена]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=138258#p138258</link>
			<description><![CDATA[<div class="codebox"><pre><code>
*XButton1::
	KeyWait := 1
	SetKeyDelay,, 64
	Send {e} 
	While !GetKeyState(&quot;LButton&quot;, &quot;P&quot;) &amp;&amp; KeyWait
		Sleep 20
	If !KeyWait
		Return
	KeyWait := 0
	Send {LButton} 
	Sleep, 500
	Send {e} 
	Return

#If KeyWait
~RButton:: KeyWait := 0
#If
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 03 Mar 2020 19:56:59 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=138258#p138258</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нажатие левой кнопки мыши - действие, нажатие правой отмена]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=138223#p138223</link>
			<description><![CDATA[<p><strong>stealzy</strong><br />спасибо за пример более оптимального кода, на будущее пригодится )</p><p>единственное что, в таком варианте при попытке отмены игрового действия правой мышью, оно просто перезагружает скрипт, а в игре отмена действия уже не срабатывает</p>]]></description>
			<author><![CDATA[null@example.com (noteless)]]></author>
			<pubDate>Mon, 02 Mar 2020 18:53:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=138223#p138223</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нажатие левой кнопки мыши - действие, нажатие правой отмена]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=138212#p138212</link>
			<description><![CDATA[<div class="codebox"><pre><code>*XButton1::
	SetKeyDelay,, 64
	Send {e}
	KeyWait LButton, D
	; Send {LButton}
	Sleep 500
	Send {e}
Return

~RButton::Reload</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Mon, 02 Mar 2020 16:33:22 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=138212#p138212</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нажатие левой кнопки мыши - действие, нажатие правой отмена]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=138207#p138207</link>
			<description><![CDATA[<p>вроде сообразил )</p><div class="codebox"><pre><code>
*XButton1::
Send {e Down}
Sleep, 64
Send {e Up}
Loop
{
if GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
 {
   Send {LButton Down}
   Sleep, 64
   Send {LButton Up}
   Sleep, 500
   Send {e Down}
   Sleep, 64
   Send {e Up}
   break
 }
if GetKeyState(&quot;RButton&quot;, &quot;P&quot;)
break
}
Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (noteless)]]></author>
			<pubDate>Mon, 02 Mar 2020 12:25:16 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=138207#p138207</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Нажатие левой кнопки мыши - действие, нажатие правой отмена]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=138206#p138206</link>
			<description><![CDATA[<p>Я не волшебник, я только учусь (с) на примерах.<br />Но подходящий пример не нашел.<br />Скрипт по нажатию кнопки нажимает Е и ждет клика левой мышью, потом отрабатывает остальное.<br />Но если нужно отменить действие (в игре это правая кнопка мыши), то игровое-то действие отменяется, а вот скрипт продолжает ждать нажатие левой кнопки мыши.<br />Как сделать, чтобы при нажатии правой кнопки мыши скрипт возвращался в исходное положение?<br />Предполагаю, что через GetKeyState и If, но все что пробовал не работает, знаний не хватает )</p><div class="codebox"><pre><code>

*XButton1::
Send {e Down}
Sleep, 64
Send {e Up}
KeyWait, LButton, D
Send {LButton Down}
Sleep, 64
Send {LButton Up}
Sleep, 500
Send {e Down}
Sleep, 64
Send {e Up}
Return

</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (noteless)]]></author>
			<pubDate>Mon, 02 Mar 2020 11:52:56 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=138206#p138206</guid>
		</item>
	</channel>
</rss>
