<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Использование скрипта при помощи AutoHotInterception.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18100&amp;type=atom" />
	<updated>2024-04-21T19:14:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18100</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование скрипта при помощи AutoHotInterception.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=160813#p160813" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#SingleInstance force
#Persistent
#include Lib\AutoHotInterception.ahk
AHI := new AutoHotInterception()
idA := AHI.GetKeyboardId(XXXXXX, XXXXXX, 1)
return
f3::
{
AHI.SendKeyEvent(idA, GetKeySC(&quot;d&quot;), 1)
AHI.SendKeyEvent(idA, GetKeySC(&quot;d&quot;), 0)
Sleep, 100
}
return</code></pre></div><p>Попробуйте так.</p>]]></content>
			<author>
				<name><![CDATA[SDInox]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43695</uri>
			</author>
			<updated>2024-04-21T19:14:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=160813#p160813</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование скрипта при помощи AutoHotInterception.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=160349#p160349" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>HAV1RAYN пишет:</cite><blockquote><p>Только недавно начал забираться в AHK</p></blockquote></div><p>И сразу взялись за AutoHotInterception? Я вот тоже вчера начал учиться на пианино. Разбираю концерт Стравинского.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2024-02-13T18:39:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=160349#p160349</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Использование скрипта при помощи AutoHotInterception.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=160348#p160348" />
			<content type="html"><![CDATA[<p>Приветствую, подскажите, пожалуйста, что может быть не так? Написал скрипт, в котором при помощи AutoHotInterception эмулируются нажатие на клавиши клавиатуры в игре.<br />В данном коде это клавиша &quot;D&quot;, которая с задержкой в 100мс должна постоянно нажиматься, но при запуске в игре выскакивает ошибка как на скриншоте. В чём может быть проблема? Как я понял, что-то не так с написанием скрипта в части SendKeyEvent(), а в что именно я сделал не так, понять не могу. Только недавно начал забираться в AHK.<br /></p><div class="codebox"><pre><code>#include C:\AutoHotInterception\Lib\AutoHotInterception.ahk

AHI := new AutoHotInterception()
keyboard1Id := AHI.GetKeyboardId(0x0E6A, 0x02C0)
cm1 := AHI.CreateContextManager(keyboard1Id)

#if cm1.IsActive	; Start the #if block
::aaa::JACKPOT
1:: 
	ToolTip % &quot;KEY DOWN EVENT @ &quot; A_TickCount
	return
	
1 up::
	ToolTip % &quot;KEY UP EVENT @ &quot; A_TickCount
	return
#if			; Close the #if block

F3::
AHI.SendKeyEvent(keyboardId, GetKeySC(&quot;d&quot;), 1)
Sleep 100
F4::Pause</code></pre></div>]]></content>
			<author>
				<name><![CDATA[HAV1RAYN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43570</uri>
			</author>
			<updated>2024-02-13T15:03:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=160348#p160348</id>
		</entry>
</feed>
