<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Скрипт на срабатывание при зажатии клавиш]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=16345&amp;type=atom" />
	<updated>2021-05-16T12:31:43Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=16345</id>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147911#p147911" />
			<content type="html"><![CDATA[<p>а если говорить про исключение какой то кнопки из уже существующего скрипта? То есть к примеру нажатие кнопок с спамом команды по модификатору ctrl,shift, alt но исключить простое нажатие без модификатора? <br />К примеру:<br />ctrl+А&nbsp; (спам)<br />shift+A (спам)<br />alt+A (спам)<br />А (исключить) <br />?</p>]]></content>
			<author>
				<name><![CDATA[Pino43t]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41734</uri>
			</author>
			<updated>2021-05-16T12:31:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147911#p147911</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147880#p147880" />
			<content type="html"><![CDATA[<p>Думаю посылать те клавиши, которые запускают команду не выйдет.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-05-15T18:46:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147880#p147880</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147879#p147879" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong><br />К сожалению Ваше предложение не решит проблему. Так как важна мобильность и отсутствие различных модификаторов для переключения (Капслок намлок и тд). Но в любом случае спасибо. Возможно, у кого то есть еще идеи как это можно сделать?</p>]]></content>
			<author>
				<name><![CDATA[Pino43t]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41734</uri>
			</author>
			<updated>2021-05-15T18:28:06Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147879#p147879</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147861#p147861" />
			<content type="html"><![CDATA[<p>Не легче ли тогда сделать запуск на одиночную клавишу?<br />Например нажатие &#039;T&#039; будет посылать Shift+(нужная клавиша). Установить эти клавиши так, чтобы не мешали стандартным (для движения / управления персонажем).<br />Переключать эти клавиши можно например через Caps Losk, Num Lock - так как видно лампочку (мол активен режим 1,2 и т.д.). В зависимости от активного индикатора клавиша &#039;T&#039; может посылать разные зажатия с &#039;Shift&#039; например.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-05-15T14:30:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147861#p147861</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147854#p147854" />
			<content type="html"><![CDATA[<p>К сожалению, данный способо также не актуален. Ужасные фризы происходят просто во время нажатия шифта, и срабатывание происходит не от комбинации а от шифта.</p>]]></content>
			<author>
				<name><![CDATA[Pino43t]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41734</uri>
			</author>
			<updated>2021-05-15T08:06:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147854#p147854</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147853#p147853" />
			<content type="html"><![CDATA[<p>Сделать в виде функции не выйдет (я по крайней мере не знаю как) - {Blind} принимает строку, которую нужно напечатать.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-05-14T22:25:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147853#p147853</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147852#p147852" />
			<content type="html"><![CDATA[<p>Тогда такой код:</p><div class="codebox"><pre><code>Shift &amp; r::
While % GetKeyState(&quot;r&quot;,&quot;P&quot;){
 SendInput, {Blind}r
}
Return

Shift &amp; q::
While % GetKeyState(&quot;q&quot;,&quot;P&quot;){
 SendInput, {Blind}q
}
Return

Shift &amp; w::
While % GetKeyState(&quot;w&quot;,&quot;P&quot;){
 SendInput, {Blind}w
}
Return

Shift &amp; 1::
While % GetKeyState(&quot;1&quot;,&quot;P&quot;){
 SendInput, {Blind}1
}
Return</code></pre></div><p>Может есть и другой способ - лень искать.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-05-14T22:24:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147852#p147852</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147843#p147843" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong><br />К сожалению данные команды исключают нажатие комбинации клавиши shift+w. То есть команда срабатывает при нажатии данной комбинации, но выводит нажатие кнопки &quot;W&quot; без модификатора....</p>]]></content>
			<author>
				<name><![CDATA[Pino43t]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41734</uri>
			</author>
			<updated>2021-05-14T06:59:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147843#p147843</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147841#p147841" />
			<content type="html"><![CDATA[<p>Наверно как-то так:</p><div class="codebox"><pre><code>RepeatPress(Key, Wait := 10){
 While % GetKeyState(key, &quot;P&quot;){
  SendInput, {%key%}
  Sleep, % Wait
 }
}

+w:: RepeatPress(&quot;w&quot;)		; Shift + W
!t:: RepeatPress(&quot;t&quot;, 0)	; Alt + T</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-05-13T17:01:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147841#p147841</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Скрипт на срабатывание при зажатии клавиш]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=147823#p147823" />
			<content type="html"><![CDATA[<p>Всем привет. Помогите, пожалуйста, разобраться как сделать так, чтобы при использовании данного скрипта, не учитывались некоторые комбинации (а точнее простые клавиши без модификаторов ctrl, alt, shift)</p><div class="codebox"><pre><code>#InstallKeybdHook

isInUse = 0

RepeatPress( key ){
    global isInUse
    loop {
        if not GetKeyState( key, &quot;P&quot; ){
            break
        }
       if not isInUse  {
            Send, {%key%}
        }
        sleep 1
    }
    return
}

RepeatPressCtrl( key ){
    global isInUse = 1
    loop {
        if not GetKeyState( key, &quot;P&quot; ){
            isInUse = 0
            break
        }
        if GetKeyState( &quot;Ctrl&quot;, &quot;P&quot; ){
            Send, ^{%key%}
        }
        sleep 1
    }
    return
}

RepeatPressShift( key ){
    global isInUse = 1
    loop {
        if not GetKeyState( key, &quot;P&quot; ){
            isInUse = 0
            break
        }
        if GetKeyState( &quot;Shift&quot;, &quot;P&quot; ){
            Send, +{%key%}
        }
        sleep 1
    }
    return
}

RepeatPressBlind( key ){
    loop {
        if not GetKeyState( key, &quot;P&quot; ){
            break
        }
        Send, {Blind}{%key%}
        sleep 1
    }
    return
}

RepeatPressRedirect( holdKey, sendKey ){
    loop {
        if not GetKeyState( holdKey, &quot;P&quot; ){
            break
        }
        Send, {Blind}{%sendKey%}
        sleep 1
    }
    return
}

#IfWinActive World of Warcraft
*End::Suspend

*1::RepeatPressBlind( &quot;1&quot; )
*2::RepeatPressBlind( &quot;2&quot; )
*4::RepeatPressBlind( &quot;4&quot; )
*5::RepeatPressBlind( &quot;5&quot; )
*7::RepeatPressBlind( &quot;7&quot; )
*f::RepeatPressBlind( &quot;f&quot; )
*r::RepeatPressBlind( &quot;r&quot; )
*v::RepeatPressBlind( &quot;v&quot; )
*t::RepeatPressBlind( &quot;t&quot; )
*к::RepeatPressBlind( &quot;к&quot; )
*ч::RepeatPressBlind( &quot;ч&quot; )
*с::RepeatPressBlind( &quot;с&quot; )
*м::RepeatPressBlind( &quot;м&quot; )
*n::RepeatPressBlind( &quot;n&quot; )
*т::RepeatPressBlind( &quot;т&quot; )
*п::RepeatPressBlind( &quot;п&quot; )
*g::RepeatPressBlind( &quot;g&quot; )
*н::RepeatPressBlind( &quot;н&quot; )
*x::RepeatPressBlind( &quot;x&quot; )
*3::RepeatPressBlind( &quot;3&quot; )
*а::RepeatPressBlind( &quot;а&quot; )
*е::RepeatPressBlind( &quot;е&quot; )</code></pre></div><br /><p>Нужно чтобы к примеру срабатывала комбинация Alt+А, но не срабатывала при обычном нажатии А. И именно команда шла спамом, до момента отжатия. Заранее огромное спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Pino43t]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41734</uri>
			</author>
			<updated>2021-05-12T10:30:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=147823#p147823</id>
		</entry>
</feed>
