<?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=12138&amp;type=atom" />
	<updated>2016-11-30T11:26:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12138</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109518#p109518" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/help.php?section=bbcode">http://forum.script-coding.com/help.php?section=bbcode</a><br />Вторая слева:<br /><span class="postimg"><img src="http://forum.script-coding.com/extensions/pun_bbcode/css/Oxygen/img/sprite.png" alt="http://forum.script-coding.com/extensions/pun_bbcode/css/Oxygen/img/sprite.png" /></span><br /></p><div class="codebox"><pre><code>Tab::
toggle := !toggle
If toggle 
   Send, {RButton down}{Space Down}
Else
   Send, {RButton Up}{Space Up}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-11-30T11:26:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109518#p109518</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109505#p109505" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Извиняюсь, не знаю как делать теговое обрамление.<br />Код при однократном нажатии на таб, зажимает ЛКМ и пробел. После повторного однократного нажатия на таб, ЛКМ и пробел перестают удерживаться.</p>]]></content>
			<author>
				<name><![CDATA[ustrashanovyura1990]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34358</uri>
			</author>
			<updated>2016-11-30T08:20:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109505#p109505</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109495#p109495" />
			<content type="html"><![CDATA[<p>Код следует обрамлять тегом code.<br />И я в вашем коде ничего не понял.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-11-29T13:57:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109495#p109495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109493#p109493" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Огромное спасибо! Ещё если можно, хотел бы уточнить, есть ли упрощённая альтернатива этому коду,и правильно ли он написан:<br /></p><div class="codebox"><pre><code>$tab::
	Send, {tab}
    If isKeyPressed := !isKeyPressed    
        SetTimer, SendA, 40            
    Else
    {
        SetTimer, SendA, Off           
        Send {LBUTTON Up}                    
	Send {Space Up} 
}
    KeyWait tab                      
    return

SendA:
    Send {LBUTTON Down}
    Send {Space Down}
    return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ustrashanovyura1990]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34358</uri>
			</author>
			<updated>2016-11-29T13:39:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109493#p109493</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109475#p109475" />
			<content type="html"><![CDATA[<p>А в чем тут сложность?<br /></p><div class="codebox"><pre><code>RButton::
Send, {RButton down}{Space Down}
KeyWait, RButton
Send, {RButton Up}{Space Up}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-11-29T03:54:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109475#p109475</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109456#p109456" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Приветствую,подскажите пожалуйста код: <br />что бы при зажатой ПКМ зажимались эта же ПКМ и пробел. при отжатой ПКМ, пробел и эта же ПКМ отжимались.</p>]]></content>
			<author>
				<name><![CDATA[ustrashanovyura1990]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34358</uri>
			</author>
			<updated>2016-11-27T22:55:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109456#p109456</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109060#p109060" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Благодарю</p>]]></content>
			<author>
				<name><![CDATA[martishlushka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34315</uri>
			</author>
			<updated>2016-11-10T16:47:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109060#p109060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109059#p109059" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#MaxThreadsPerHotkey 10
~sc39 &amp; 1::
~sc39 &amp; 2::
~sc39 &amp; 3::
~sc39 &amp; 4::
~sc39 &amp; 5::
~sc39 &amp; sc13::
key := RegexReplace(A_ThisHotKey, &quot;.*\s&quot;)
if (key = &quot;sc13&quot;)  
   key := 23
if (keys != &quot;&quot;)
   return
While GetKeyState(&quot;sc39&quot;, &quot;P&quot;)
{
   If !key
      Continue
   keys .= key
   key := &quot;&quot;                        
}  
msgbox % keys 
keys := &quot;&quot;
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-11-10T15:52:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109059#p109059</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109058#p109058" />
			<content type="html"><![CDATA[<p>Какое-то время буквы работали нормально, но пока их добавлял что-то сбилось. Оставил главную часть скрипта, все равно та же проблема осталась. При зажатии пробела и r высвечивает тройку вместо 23. Изменение значения не изменяет тройку. А с числами все нормально<br /></p><div class="codebox"><pre><code>#MaxThreadsPerHotkey 10
~sc39 &amp; 1::
~sc39 &amp; 2::
~sc39 &amp; 3::
~sc39 &amp; 4::
~sc39 &amp; 5::
~sc39 &amp; sc13::
key := substr(A_ThisHotKey, StrLen(A_ThisHotKey))
If AlreadyRun
   return
AlreadyRun := 1
While GetKeyState(&quot;sc39&quot;, &quot;P&quot;)
{
  If sc39 &amp; key
      Continue
	if (key = &quot;sc13&quot;)  
		key := 23
   keys .= key
   key := &quot;&quot; 
}  
msgbox % keys 
AlreadyRun := keys := &quot;&quot;
return      </code></pre></div>]]></content>
			<author>
				<name><![CDATA[martishlushka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34315</uri>
			</author>
			<updated>2016-11-10T15:27:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109058#p109058</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109057#p109057" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[martishlushka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34315</uri>
			</author>
			<updated>2016-11-10T14:48:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109057#p109057</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109056#p109056" />
			<content type="html"><![CDATA[<p>Замените:<br /></p><div class="codebox"><pre><code>key := RegexReplace(A_ThisHotKey, &quot;^.&quot;)</code></pre></div><p>на:<br /></p><div class="codebox"><pre><code>key := substr(A_ThisHotKey, StrLen(A_ThisHotKey))</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-11-10T14:24:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109056#p109056</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109055#p109055" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Спасибо!&nbsp; Скрипт с клавишей R работает так как нужно.</p><p>Если при зажатом пробеле нажимается клавиша, которая используется в комбинации, то он должен выполнить скрипт. А если&nbsp; пробел нажат и опущен, то сработает как обычно.<br />Пробовал изменить код вместо </p><div class="codebox"><pre><code>!3::  </code></pre></div><p>сделал</p><div class="codebox"><pre><code> sc39 &amp; 3::</code></pre></div><p> и вместо</p><div class="codebox"><pre><code> Alt</code></pre></div><p> написал </p><div class="codebox"><pre><code>Space</code></pre></div><p>Но в итоге выдает не тройку, а </p><div class="codebox"><pre><code>c39 &amp; 3</code></pre></div><p>Если</p><div class="codebox"><pre><code> ~sc39 &amp; 3::</code></pre></div><p> тогда</p><div class="codebox"><pre><code> sc39 &amp; 3</code></pre></div>]]></content>
			<author>
				<name><![CDATA[martishlushka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34315</uri>
			</author>
			<updated>2016-11-10T14:05:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109055#p109055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109054#p109054" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Как добавить в код, чтобы при нажатии на клавишу R скрипт вводил комбинацию 2 и 3 при зажатой альт?</p></blockquote></div><div class="codebox"><pre><code>#MaxThreadsPerHotkey 10
!1::
!2::
!3::
!4::
!5::
!r::
key := RegexReplace(A_ThisHotKey, &quot;^.&quot;)
If AlreadyRun
   return
AlreadyRun := 1
While GetKeyState(&quot;Alt&quot;, &quot;P&quot;)
{
   If !key
      Continue
   if (key = &quot;r&quot;)
      key := 23
   keys .= key
   key := &quot;&quot;
}
msgbox % keys
AlreadyRun := keys := &quot;&quot;
return</code></pre></div><div class="quotebox"><blockquote><p>А как в этом коде, если что, поменять альт на другую клавишу, пробел, например?</p></blockquote></div><p>А как скрипт узнает для чего нажат пробел?<br />На контрол меняется так:<br /></p><div class="codebox"><pre><code>#MaxThreadsPerHotkey 10
^1::
^2::
^3::
^4::
^5::
^r::
key := RegexReplace(A_ThisHotKey, &quot;^.&quot;)
If AlreadyRun
   return
AlreadyRun := 1
While GetKeyState(&quot;Ctrl&quot;, &quot;P&quot;)
{
   If !key
      Continue
   if (key = &quot;r&quot;)
      key := 23
   keys .= key
   key := &quot;&quot;
}
msgbox % keys
AlreadyRun := keys := &quot;&quot;
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-11-10T13:15:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109054#p109054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109052#p109052" />
			<content type="html"><![CDATA[<p>И еще. Как добавить в код, чтобы при нажатии на клавишу R скрипт вводил комбинацию 2 и 3 при зажатой альт?<br />Как ни пробовал, на выходе sc13 либо пусто</p>]]></content>
			<author>
				<name><![CDATA[martishlushka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34315</uri>
			</author>
			<updated>2016-11-10T12:23:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109052#p109052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Комбинация клавиш при зажатой кнопке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109050#p109050" />
			<content type="html"><![CDATA[<p>Спасибо, работает!<br />А как в этом коде, если что, поменять альт на другую клавишу, пробел, например?</p>]]></content>
			<author>
				<name><![CDATA[martishlushka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34315</uri>
			</author>
			<updated>2016-11-10T10:50:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109050#p109050</id>
		</entry>
</feed>
