<?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=16457</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16457&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Переключение и удержание клавиши.».]]></description>
		<lastBuildDate>Sun, 27 Jun 2021 20:56:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Переключение и удержание клавиши.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=148632#p148632</link>
			<description><![CDATA[<p>Можно в этой строчке<br /></p><div class="codebox"><pre><code>KeyWait, %key%, T.3</code></pre></div><p>изменить T.3 на T.2 (на меньшее значение), чтобы успевало срабатывать при удержании.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 27 Jun 2021 20:56:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=148632#p148632</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переключение и удержание клавиши.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=148631#p148631</link>
			<description><![CDATA[<p><strong>teadrinker</strong></p><p>Благодарю! Все работает отлично.</p>]]></description>
			<author><![CDATA[null@example.com (Seres)]]></author>
			<pubDate>Sun, 27 Jun 2021 20:51:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=148631#p148631</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переключение и удержание клавиши.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=148630#p148630</link>
			<description><![CDATA[<p>Тогда так:<br /></p><div class="codebox"><pre><code>shiftState := 0
*$LShift::
*$RShift::
   key := SubStr(A_ThisHotkey, -5)
   Send, {%key% Down}
   KeyWait, %key%, T.3
   if ErrorLevel {
      KeyWait, %key%
      Send, {%key% Up}
      shiftState := 0
   }
   else if !(shiftState := !shiftState)
      Send {LShift Up}{RShift Up}
   Return</code></pre></div><div class="quotebox"><cite>Seres пишет:</cite><blockquote><p>Версия AHK 1.1.28</p></blockquote></div><p>Должно работать и с этой версией, но вообще предполагается, что выложенный на форуме код будет работать с самой свежей версией AHK (и не обязательно с предыдущими), так что лучше всегда обновляться.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 27 Jun 2021 20:08:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=148630#p148630</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переключение и удержание клавиши.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=148629#p148629</link>
			<description><![CDATA[<p><strong>teadrinker</strong></p><p>Спасибо за ответ, но к сожалению не работает. Если удерживать и потом отпустить физ кнопку клавиша остается нажатой, если удерживается скриптом зажать физ кнопку, то скрипт отпускает. В общем, просто как зажатый шифт клавиша не работает. Если это имеет какое-то значение, то скрипт нужен для Blender-а. Версия AHK 1.1.28</p>]]></description>
			<author><![CDATA[null@example.com (Seres)]]></author>
			<pubDate>Sun, 27 Jun 2021 19:29:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=148629#p148629</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Переключение и удержание клавиши.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=148626#p148626</link>
			<description><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>shiftState := 0
$Shift::
   KeyWait, Shift, 300
   if ErrorLevel {
      Send, {Shift Down}
      KeyWait, Shift
      Send, {Shift Up}
      shiftState := 0
   }
   else {
      if shiftState := !shiftState
         Send {Shift Down}
      else
         Send {Shift Up}
   }
   Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 27 Jun 2021 18:00:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=148626#p148626</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Переключение и удержание клавиши.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=148624#p148624</link>
			<description><![CDATA[<div class="codebox"><pre><code>
stateShift:=0
Shift::
	Sleep, 150
	GetKeyState, state, Shift, P;
	If state = U
	{
		If (stateShift=0)
		{
			send {Shift down}
			stateShift:=1
		}
		Else
		{
			send {Shift up}
			stateShift:=0
		}
	}
	Else
	{
		If (stateShift=0)
		{
			stateShift:=1
			send {Shift up}
		}
	}
Return
</code></pre></div><p>Что нужно:<br />Первое нажатие не удерживая клавишу -&gt; клавиша зажата скриптом.<br />Второе нажатие не удерживая клавишу -&gt; клавиша отжата скриптом.<br />Клавиша удерживается физически -&gt; работает как обычная клавиша, но если была зажата скриптом,&nbsp; то будет отпущена после физического отжатия клавиши.</p><p>Я не пойму как сделать физ. удержание, работает только как переключатель.</p>]]></description>
			<author><![CDATA[null@example.com (Seres)]]></author>
			<pubDate>Sun, 27 Jun 2021 14:58:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=148624#p148624</guid>
		</item>
	</channel>
</rss>
