<?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=16912&amp;type=atom" />
	<updated>2022-01-28T15:21:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16912</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151844#p151844" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Так заход в ветку начинается с той строчки, где прописана горячая клавиша.</p></blockquote></div><p>Мне казалось, что в моем изначальном примере условием захода должно было выступать состояние нажатия на s<br /></p><div class="codebox"><pre><code>if state = D</code></pre></div><p>Видимо я был неправ, спасибо вам еще раз за помощь!</p>]]></content>
			<author>
				<name><![CDATA[vasyausov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42311</uri>
			</author>
			<updated>2022-01-28T15:21:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151844#p151844</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151843#p151843" />
			<content type="html"><![CDATA[<p>Так заход в ветку начинается с той строчки, где прописана горячая клавиша. Фигурные скобки в данном случае ничего не меняют. Кстати, в примере с директивой они тоже не нужны. Директива распространяется на все ГК, что ниже.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-01-28T15:04:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151843#p151843</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151842#p151842" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А что вас смущает?</p></blockquote></div><p>Без вас бы не понял, что в моем случае это не сработает, обычно в ЯП всё-таки условия проверяются и исполняется то, что при заходе в ветку описывается.<br />В моём случае при заходе в ветку операция не выполнялась, это и смущало.</p>]]></content>
			<author>
				<name><![CDATA[vasyausov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42311</uri>
			</author>
			<updated>2022-01-28T15:00:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151842#p151842</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151840#p151840" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>vasyausov пишет:</cite><blockquote><p>Просто в примере самого ahk почему-то именно такая конструкция</p></blockquote></div><p>А что вас смущает? Это к горячим клавишам не имеет отношения.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-01-28T14:46:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151840#p151840</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151837#p151837" />
			<content type="html"><![CDATA[<p><strong>vasyausov</strong>, ознакомьтесь, пожалуйста, с <a href="https://forum.script-coding.com/misc.php?action=rules">Правилами</a>, отредактируйте свой пост. Обратите внимание на заглавные <a href="https://forum.script-coding.com/misc.php?action=rules#literacy">буквы</a> в начале предложений и правила <a href="https://forum.script-coding.com/misc.php?action=rules#quotation">цитирования</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-01-28T14:31:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151837#p151837</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151836#p151836" />
			<content type="html"><![CDATA[<p>Cпасибо, вроде помогло, вот такое работает: <br /></p><div class="codebox"><pre><code>#if GetKeyState(&quot;s&quot;, &quot;P&quot;)
{
	d::a
	a::d
}	</code></pre></div><p>Просто в примере самого <a href="https://www.autohotkey.com/docs/commands/GetKeyState.htm">ahk</a> почему-то именно такая конструкция<br /></p><div class="codebox"><pre><code>
GetKeyState, state, Shift
if (state = &quot;D&quot;)
    MsgBox At least one Shift key is down.
else
    MsgBox Neither Shift key is down.</code></pre></div>]]></content>
			<author>
				<name><![CDATA[vasyausov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42311</uri>
			</author>
			<updated>2022-01-28T14:28:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151836#p151836</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151835#p151835" />
			<content type="html"><![CDATA[<p>Код в AHK исполняется сверху вниз, так что когда вы нажимаете горячую клавишу, он не может прыгнуть на пару строк вверх, чтобы проверить условие. Но есть специальный способ создания контекстно-зависимых горячих клавиш с помощью <a href="https://www.autohotkey.com/docs/Hotkeys.htm#Context">директив</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-01-28T13:45:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151835#p151835</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: при нажатии кнопки менялись местами клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151833#p151833" />
			<content type="html"><![CDATA[<p>Хочу чтобы при зажатой кнопке s кнопка a менялась на d&nbsp; и наоборот, но не работает. <br />По факту получается, что не проверяет условие нажатия кнопки, а просто всегда работает безусловно, как если бы было просто <br /></p><div class="codebox"><pre><code>	d::a
	a::d</code></pre></div><p>Что я делаю не так? </p><div class="codebox"><pre><code>GetKeyState, state, s
if state = D
{
	d::a
	a::d
}	
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[vasyausov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42311</uri>
			</author>
			<updated>2022-01-28T13:22:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151833#p151833</id>
		</entry>
</feed>
