<?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=7365&amp;type=atom" />
	<updated>2012-07-18T04:49:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7365</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Действия при нажатии и отпускании кнопок мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61710#p61710" />
			<content type="html"><![CDATA[<p>Спасибо за ответ! Я догадывался, что при нажатии не нужно отслеживать состоянии кнопки, но не сделал))) <br />А про<br /></p><div class="codebox"><pre><code>Xbutton1 Up::</code></pre></div><p>вообще не догадался)))</p>]]></content>
			<author>
				<name><![CDATA[Dutchnick]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28351</uri>
			</author>
			<updated>2012-07-18T04:49:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61710#p61710</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Действия при нажатии и отпускании кнопок мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61690#p61690" />
			<content type="html"><![CDATA[<p><strong>KeyWait</strong> полезен в случае, если требуется выполнить некое действие однократно <strong>при нажатии клавиши клавиатуры</strong> — игнорируя генерируемый автоповтор нажатий, который, при неиспользовании KeyWait, будет вызывать выполнение действий привязанных к событию нажатия&nbsp; с частотой установленной в «настройках клавиатуры».<br />Кнопки мыши отправляются однократно при нажатии и отпускании.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-07-17T19:01:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61690#p61690</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Действия при нажатии и отпускании кнопок мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61688#p61688" />
			<content type="html"><![CDATA[<p>Фрагмент :<br /></p><div class="codebox"><pre><code>XButton1::

GetKeyState, state, XButton1, P
    if state = D</code></pre></div><p>бессмысленен — сразу после нажатия вы проверяете нажата ли клавиша, будьте уверены, вы не успеете отпустить клавишу ранее, чем выполнится проверка нажата ли она <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Суть вопроса: нажатие кнопки — одно действие, отпускание — другое.<br />Пример:<br /></p><div class="codebox"><pre><code>XButton1::Run, G:\MPC-Homecinema.1.3.1249.0.(x86)\mpc-hc.exe  G:\3.avi /play
Xbutton1 Up::
    IfWinExist,  Media Player Classic 
        WinKill
    return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-07-17T18:54:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61688#p61688</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Действия при нажатии и отпускании кнопок мыши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61686#p61686" />
			<content type="html"><![CDATA[<p>Вечер добрый!</p><p>Есть задача, при нажатии кнопок&nbsp; MButton или XButton1 или XButton2 запускается видео, на каждой кнопке свой. При отпускании кнопки, должен закрыватся последний ролик, пока все кнопки не будут отжаты. Например: Нажимаем МВ запускается ролик 1, кнопку ХВ1 - ролик 2, ХВ2 - ролик 3, при отпускании МВ выключается ролик3, ХВ2 - ролик 2, ХВ1 - ролик1, т.е в обратном порядке.</p><p>Я делаю </p><div class="codebox"><pre><code>XButton1::

GetKeyState, state, XButton1, P
    if state = D 
Run, G:\MPC-Homecinema.1.3.1249.0.(x86)\mpc-hc.exe  G:\3.avi /play
KeyWait, XButton1, U
IfWinExist,  Media Player Classic 
        WinKill
Return

XButton2::

GetKeyState, state, XButton2, P
    if state = D 
Run, G:\MPC-Homecinema.1.3.1249.0.(x86)\mpc-hc.exe  G:\3.avi /play
KeyWait, XButton2, U
IfWinExist,  Media Player Classic 
        WinKill
Return

MButton::

GetKeyState, state, MButton, P
    if state = D 
Run, G:\MPC-Homecinema.1.3.1249.0.(x86)\mpc-hc.exe  G:\3.avi /play
KeyWait, МButton, U
IfWinExist,  Media Player Classic 
        WinKill
Return</code></pre></div><p>Но в этом случае скрипт ждет пока не отработает KeyWait&nbsp; и поэтому при нажатой ХВ1 и ХВ2, и отпускании ХВ1, скрипт не отрабатывает т.к. ждет KeyWait в XButton2:: </p><p>Помогите разобратся.</p>]]></content>
			<author>
				<name><![CDATA[Dutchnick]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28351</uri>
			</author>
			<updated>2012-07-17T18:18:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61686#p61686</id>
		</entry>
</feed>
