<?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=18370&amp;type=atom" />
	<updated>2025-07-07T21:55:37Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18370</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: странные эффекты при нажатии комбинаций кнопок:]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162532#p162532" />
			<content type="html"><![CDATA[<p>прошу прощения, что не ответил. Это заработало, спасибо. Еще раз прошу прощения, что оставил добрый совет без реакции, извините.</p>]]></content>
			<author>
				<name><![CDATA[RacalCucumber]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41299</uri>
			</author>
			<updated>2025-07-07T21:55:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162532#p162532</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: странные эффекты при нажатии комбинаций кнопок:]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161999#p161999" />
			<content type="html"><![CDATA[<p><strong>RacalCucumber</strong>, Да всё верно, простая короткая отправка события нажатия и отпускания клавиши.</p><p>Возможно такой код сработает:</p><div class="codebox"><pre><code>+RButton::
SendInput, {vk2 Down}	; Зажать ПКМ.
Sleep, 1000
SendInput, {0} ; Нажать &#039;0&#039;.
KeyWait, RButton, U	; Ожидать отпускания ПКМ.
SendInput, {vk2 Up}	; Поднять ПКМ.
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2025-02-18T14:41:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161999#p161999</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: странные эффекты при нажатии комбинаций кнопок:]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161998#p161998" />
			<content type="html"><![CDATA[<p>В логе shift отпускается. Это ты его отпускаешь?<br /></p><div class="quotebox"><blockquote><p>A0&nbsp; 02A	i	u	1.00	LShift</p></blockquote></div><p>Вот такой вариант, чтобы shift не дергался:<br /></p><div class="codebox"><pre><code>~*f1::
sleep,100

if getkeystate(&quot;Shift&quot;,&quot;D&quot;)
  Send {)}
else
  send {0}

KeyHistory
return

esc::exitapp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2025-02-18T12:52:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161998#p161998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: странные эффекты при нажатии комбинаций кнопок:]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161987#p161987" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong><br />Послать нажатие кнопки 0</p><p>SendInput {0} это же именно &quot;послать&quot; а не &quot;зажать&quot;, я же не чего не путаю?</p>]]></content>
			<author>
				<name><![CDATA[RacalCucumber]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41299</uri>
			</author>
			<updated>2025-02-17T18:25:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161987#p161987</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: странные эффекты при нажатии комбинаций кнопок:]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161986#p161986" />
			<content type="html"><![CDATA[<p>Необходимо послать в окно игры &#039;0&#039; или зажать и удерживать?</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2025-02-16T20:29:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161986#p161986</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: странные эффекты при нажатии комбинаций кнопок:]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161985#p161985" />
			<content type="html"><![CDATA[<p>Есть игра. В ней: <br />W - движение вперед<br />+зажатый Shift - бег<br />При этом зажатие правой кнопку мышки вызывает приостановку бега и переход в режим прицеливания. <br />При этом нажатие (клик) на кнопку 0 вызывает задержку дыхания. </p><p>Все хорошо и все работает. Задача автоматизировать нажатие кнопки 0 при зажатии правой кнопки мышки. </p><p>Пишу на луа, для логитеха:<br /></p><div class="codebox"><pre><code>
function OnEvent(event, arg)
if (event == &quot;MOUSE_BUTTON_PRESSED&quot; and arg == 2) then
Sleep(100)
PressAndReleaseKey(&quot;0&quot;)
end
end
</code></pre></div><p>Что бы проверить, поддерживает такое &quot;пианино&quot; из кнопок сама игра. Все работает.</p><p>Пишу на ahk:<br /></p><div class="codebox"><pre><code>
~*RButton::
	Sleep, 1000
	SendInput {0}
Return
</code></pre></div><p>Происходит следующее. Происходит переход в прицельный режим по нажатию правой кнопки мышки, оттикивает слип, затем нажимается 0 и как будто отпускается удерживаемая правая кнопка мышки, происходит выход из прицельного режима.<br />При этом в логе ahk ничего нет:<br /></p><div class="codebox"><pre><code>02  000	h	d	7.55	RButton        	- тут я нажимаю на правую кнопку мышки при зажатом Shift
A0  02A	i	u	1.00	LShift         	
30  00B	i	d	0.00	0              	
30  00B	i	u	0.00	0              	- тут прошел sendinput и игра вышла из прицельного режима, как будто бы я отпустил правую кнопку мышки
02  000	 	u	6.81	RButton        - а это я отпустил правую кнопку мышки на мышке в реальности. </code></pre></div><p>В памяти компьютера больше ничего не варится (и аналогичный скрипт на lua то срабатывает как и надо). </p><p>Как так то?! В чем косяк?</p>]]></content>
			<author>
				<name><![CDATA[RacalCucumber]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41299</uri>
			</author>
			<updated>2025-02-16T19:30:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161985#p161985</id>
		</entry>
</feed>
