<?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="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18065&amp;type=atom" />
	<updated>2024-01-13T18:04:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18065</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Кликнуть левой удерживая правую клавишу мыши.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=159903#p159903" />
			<content type="html"><![CDATA[<p>Описание и код не сходятся. Я бы так написал:</p><div class="codebox"><pre><code>SetMouseDelay, 500
SendMode Input
isEnabled = 0
Return

#If (isEnabled = 1)
$LButton::
Sleep, 100
While(GetKeyState(&quot;LButton&quot;, &quot;P&quot;)){
 Send, {RButton Down}	; Зажать ПКМ.
 Sleep, 20
 Send, {LButton}	; Нажать ЛКМ.
 Sleep, 250
 Send, {RButton Up}	; Отпустить ПКМ.
 Sleep, 350
 Send, {LButton}	; Нажать ЛКМ.
 Sleep, 350
 Send, {LButton}	; Нажать ЛКМ.
}
Return
#If

x Up::
isEnabled := !isEnabled
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2024-01-13T18:04:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=159903#p159903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Кликнуть левой удерживая правую клавишу мыши.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=159896#p159896" />
			<content type="html"><![CDATA[<p>Здравствуйте. Помогите пожалуйста поправить макрос. <br />1)<br />-Зажать и удерживать правую клавишу мыши<br />*Пауза *мс<br />*Кликнуть левой клавишей мыши<br />*Пауза *мс<br />-Отпустить правую клавишу мыши.<br />*Пауза *мс.<br />*Два раза кликнуть левой клавишей мыши с интервалом 350мс.<br />(Цикл должен повторяться пока удерживается левая клавиша мыши.)<br />Включать, отключать по клавише X</p><div class="codebox"><pre><code>#NoEnv
#Persistent

SetMouseDelay, 500
SendMode Input

global isEnabled = 0

x Up::
toggleScript()
Return

Toggle:=false

~$LButton::
if(global isEnabled)
While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
	
	{
 Send {LButton down}
	Sleep, 20
 Send {LButton up}
	Sleep, 250
 Send {LButton down}
	Sleep, 20
 Send {LButton up}
	sleep, 350
Send {RButton down}
		Sleep, 200
Send {LButton down}
		Sleep, 20
Send {RButton up}
			
Send {RButton up}
	sleep, 200
	}
	
return
	
toggleScript()
{
global isEnabled = !(global isEnabled)
}</code></pre></div><p> <br />Работает, вроде<br />PS. Может кто подскажет, как сюда добавить условия-<br />Если нажата клавиша 1,2,3,4 то остановить выполнение цикла на клавиши мыши на 700 мс либо до следующего зажимания на лкм</p>]]></content>
			<author>
				<name><![CDATA[cubikoff]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40457</uri>
			</author>
			<updated>2024-01-13T13:02:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=159896#p159896</id>
		</entry>
</feed>
