<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Определенное выполнение действий при зажатой клавише]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8213</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8213&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Определенное выполнение действий при зажатой клавише».]]></description>
		<lastBuildDate>Sat, 06 Apr 2013 17:18:23 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Определенное выполнение действий при зажатой клавише]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=71117#p71117</link>
			<description><![CDATA[<p>Спасибо огромное работает <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Sat, 06 Apr 2013 17:18:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=71117#p71117</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определенное выполнение действий при зажатой клавише]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=71116#p71116</link>
			<description><![CDATA[<div class="codebox"><pre><code>processName := &quot;процес.exe&quot;
Address := 0xB6EC2E

vk58::
    ProcessWriteMemory(0, Address, processName, &quot;Char&quot;) ; включено
    KeyWait vk58
    ProcessWriteMemory(1, Address, processName, &quot;Char&quot;) ; выключено
    return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Sat, 06 Apr 2013 15:22:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=71116#p71116</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определенное выполнение действий при зажатой клавише]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=71115#p71115</link>
			<description><![CDATA[<p>Лучше KeyWait использовать, т.е. ожидать отпускания клавиши.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 06 Apr 2013 13:52:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=71115#p71115</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Определенное выполнение действий при зажатой клавише]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=71114#p71114</link>
			<description><![CDATA[<p>Здравствуйте. Пытаюсь сделать скрипт что бы при зажатой клавише например vk58 (X) в адресе памяти записывался 0 байт то есть включено, а при отжатой X в адресе памяти записывалось значение = 1 байт то есть выключено.<br />Адрес куда вписывать значение = 0xB6EC2E.<br />Значение вписывать в byte то есть Char 1 - выкл, 0 - вкл.</p><div class="codebox"><pre><code>processName := &quot;процес.exe&quot;
Address := 0xB6EC2E

vk58::
    Loop {
        ProcessWriteMemory(0, baseAddressPointer, processName, &quot;Char&quot;) ; включено
        If(GetKeyState(&quot;vk58&quot;, &quot;P&quot;)=0)
            ProcessWriteMemory(1, baseAddressPointer, processName, &quot;Char&quot;) ; выключено
    }

ProcessWriteMemory(data, address, processIDorName, type := &quot;Int&quot;, numBytes := 4) {
    VarSetCapacity(buf, numBytes, 0)
    NumPut(data, buf, 0, type)

    Process Exist, %processIDorName%
    if !processID := ErrorLevel
        throw Exception(&quot;Invalid process name or process ID:`n`n&quot;&quot;&quot; . processIDorName . 

&quot;&quot;&quot;&quot;)

    if !processHandle := DllCall(&quot;OpenProcess&quot;, &quot;Int&quot;, 40, &quot;UInt&quot;, 0, &quot;UInt&quot;, processID, 

&quot;Ptr&quot;)
        throw Exception(&quot;Failed to open process.`n`nError code:`t&quot; . A_LastError)

    result := DllCall(&quot;WriteProcessMemory&quot;, &quot;Ptr&quot;, processHandle, &quot;Ptr&quot;, address, &quot;Ptr&quot;, 

&amp;buf, &quot;Ptr&quot;, numBytes, &quot;UInt&quot;, 0, &quot;UInt&quot;)

    if !DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, processHandle, &quot;UInt&quot;) &amp;&amp; !result
        throw Exception(&quot;Failed to close process handle.`n`nError code:`t&quot; . A_LastError)

    if !result
        throw Exception(&quot;Failed to write process memory.`n`nError code:`t&quot; . A_LastError)

    return result
}</code></pre></div><p>Когда зажимаю X то нормально работает, но когда я отжимаю X то видно что оно то врубается то вырубается.<br />Можно как-то сделать что бы, когда я зажал клавишу X он вписал в память 1 раз 0 байт - включено, а когда я отжал X - вписал 1 байт - выключено?</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Sat, 06 Apr 2013 13:47:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=71114#p71114</guid>
		</item>
	</channel>
</rss>
