<?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=6521&amp;type=atom" />
	<updated>2015-05-26T22:02:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6521</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=94220#p94220" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Grey пишет:</cite><blockquote><p>Не вопрос <img src="//forum.script-coding.com/img/smilies/lol.png" width="15" height="15" />:</p><div class="codebox"><pre><code>~LButton::
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      Click, D
      Sleep, 15000
      Click, U
      Sleep, 40000
   }
   Return</code></pre></div></blockquote></div><p>Спасибо. Пока что лучший ответ что я нашел по этому вопросу. Пробуя тоже самое через &quot;SentPlay, {LButton down}&quot; и &quot;SentPlay, {LButton up}&quot; я получал лишь одиночные нажатия, а не удержания клавиш нужное время. Но для, например, Counter Strike 1.6, при отпускании кнопки мыши происходить еще одно нажатие/отпускание в конце конструкции. И она иногда плохо работает при других активных кнопках. Можешь посоветовать, чем можно дополнить код, для уменьшения конфликтов между конструкцией &quot;макроса&quot; и моими нажатиями на другие клавиши?</p>]]></content>
			<author>
				<name><![CDATA[ModUp]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33084</uri>
			</author>
			<updated>2015-05-26T22:02:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=94220#p94220</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54383#p54383" />
			<content type="html"><![CDATA[<p>Не вопрос <img src="//forum.script-coding.com/img/smilies/lol.png" width="15" height="15" />:</p><div class="codebox"><pre><code>~LButton::
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      Click, D
      Sleep, 15000
      Click, U
      Sleep, 40000
   }
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-12-08T19:05:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54383#p54383</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54382#p54382" />
			<content type="html"><![CDATA[<p>Grey не работает почему то? Можно убрать проверки эти? Без них было всё ок <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Dizzy221]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26614</uri>
			</author>
			<updated>2011-12-08T18:34:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54382#p54382</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54380#p54380" />
			<content type="html"><![CDATA[<p>Собственно я добавил проверку после нажатия, на предмет завершения потока в случае, если клавиша будет нажата без удержания, и сделал хоткей прозрачным (~), чтобы опять-таки избежать блокирования. Не лишним будет ещё сюда добавить проверку после генерируемого отжатия: </p><div class="codebox"><pre><code>~LButton::
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      Click, D
      Sleep, 75
      If !GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
         Break
      Sleep, 14925
      Click, U
      Sleep, GetKeyState(&quot;LButton&quot;, &quot;P&quot;) ? 40000:-1
   }
   Return</code></pre></div><p>В общем вот такая конструкция: </p><div class="codebox"><pre><code>LButton:: ; время сознательно уменьшено
   ToolTip, Start tread, A_ScreenWidth/2, A_ScreenHeight/2-25
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      ToolTip, Down, A_ScreenWidth/2, A_ScreenHeight/2, 2
      Sleep, 250
      ToolTip,,,, 3
      If !GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
         Break
      Sleep, 1500
      ToolTip, Up, A_ScreenWidth/2, A_ScreenHeight/2+25, 3
      Sleep, 250
      ToolTip,,,, 2
      Sleep, GetKeyState(&quot;LButton&quot;, &quot;P&quot;) ? 4000:-1
   }
   ToolTip, Complete tread, A_ScreenWidth/2, A_ScreenHeight/2+50, 4
   Sleep, 250
   Loop, 4
      ToolTip,,,, A_Index
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-12-08T18:28:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54380#p54380</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54375#p54375" />
			<content type="html"><![CDATA[<p>Grey спс, кстати раньше код работал, потом ты что то отредактировал и теперь нет</p>]]></content>
			<author>
				<name><![CDATA[Dizzy221]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26614</uri>
			</author>
			<updated>2011-12-08T16:42:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54375#p54375</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54373#p54373" />
			<content type="html"><![CDATA[<p><a href="http://www.script-coding.com/AutoHotkey/IfWinActive.html">#IfWinActive</a>.</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-12-08T16:27:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54373#p54373</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54372#p54372" />
			<content type="html"><![CDATA[<p>А почему этот код не работает в приложении?</p>]]></content>
			<author>
				<name><![CDATA[Dizzy221]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26614</uri>
			</author>
			<updated>2011-12-08T16:17:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54372#p54372</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54242#p54242" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>~LButton::
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      Click, D
      Sleep, 75
      If !GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
         Break
      Sleep, 14925
      Click, U
      Sleep, 40000
   }
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-12-04T13:00:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54242#p54242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: нажатая кнопка мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54241#p54241" />
			<content type="html"><![CDATA[<p>Здравствуйте!<br />Помогите, пожалуйста, составить следующий скрипт:<br />Нажимается кнопка мыши (левая) и держится нажатой в течении 15 сек, затем на 40 сек отжимается и по-новой.</p>]]></content>
			<author>
				<name><![CDATA[Dizzy221]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26614</uri>
			</author>
			<updated>2011-12-04T11:59:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54241#p54241</id>
		</entry>
</feed>
