<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Отключение при отжатии модификаторов shift, alt, ctrl в скрипте]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=18542&amp;type=atom" />
	<updated>2026-01-09T14:59:06Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=18542</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отключение при отжатии модификаторов shift, alt, ctrl в скрипте]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=163018#p163018" />
			<content type="html"><![CDATA[<p>Сам разобрался, спасибо нейросетке, ахренительная штука, всем советую.</p>]]></content>
			<author>
				<name><![CDATA[sirusianin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=45262</uri>
			</author>
			<updated>2026-01-09T14:59:06Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=163018#p163018</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Отключение при отжатии модификаторов shift, alt, ctrl в скрипте]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=163014#p163014" />
			<content type="html"><![CDATA[<p>Доброго времени суток. Купил у человека скрипт для игры. Функционал простой, он спамит зажатую мной кнопку. Почти сразу столкнулся с проблемой, при использовании модификаторов. Зажимаю кнопку 1, идет заспам, зажимаю 2 не отпуская 1, скрипт переключается и идет заспам 2, отпускаю 2, возвращается спам 1. Но если жать shift+1 и отпустить shift чуть раньше 1, то скрипт начинает спамить 1, и это полностью ломает смысл использования. Обратился к человеку, он сказал, что это работает так и никак иначе. Возможно ли сделать так, чтобы при отпускании shift, alt, ctrl кнопка в сочетании с которой они были нажаты не начинала заспам, а скрипт останавливался, до новой команды?<br /></p><div class="codebox"><pre><code>#InstallKeybdHook
#InstallMouseHook

isInUse = 0
delay = 80

RepeatPress( key ) {
	global isInUse
	global delay

	loop {
		if not GetKeyState( key, &quot;P&quot; ){
			break
		}

		if not isInUse  {
			Send, {%key%}
		}

		sleep delay
	}
	return
}

RepeatPressCtrl( key ){
	global isInUse = 1
	global delay

	loop {
		if not GetKeyState( key, &quot;P&quot; ) {
			isInUse = 0
			break
		}

		if GetKeyState( &quot;Ctrl&quot;, &quot;P&quot; ) {
			Send, ^{%key%}
		}

		sleep delay
	}
	return
}

RepeatPressShift( key ) {
	global isInUse = 1
	global delay

	loop {
		if not GetKeyState( key, &quot;P&quot; ) {
			isInUse = 0
			break
		}

		if GetKeyState( &quot;Shift&quot;, &quot;P&quot; ){
			Send, +{%key%}
		}

		sleep delay
	}
	return
}

RepeatPressBlind( key, special_delay ) {
	global delay
	
	loop {
		if not GetKeyState( key, &quot;P&quot; ) {
			break
		}

		Send, {Blind}{%key%}
		;sleep delay
		sleep special_delay
	}
	return
}

RepeatPressRedirect( holdKey, sendKey ) {
	global delay
	
	loop {
		if not GetKeyState( holdKey, &quot;P&quot; ) {
			break
		}

		Send, {Blind}{%sendKey%}
		sleep delay
	}
	return
}


#IfWinActive, World of Warcraft
~Enter::Suspend
#IfWinActive

*Pause::Suspend
;~Enter::Suspend


F1::RepeatPressBlind( &quot;F1&quot;, delay )
F2::RepeatPressBlind( &quot;F2&quot;, delay )
F3::RepeatPressBlind( &quot;F3&quot;, delay )
F4::RepeatPressBlind( &quot;F4&quot;, delay )
F5::RepeatPressBlind( &quot;F5&quot;, delay )
F6::RepeatPressBlind( &quot;F6&quot;, delay )
F7::RepeatPressBlind( &quot;F7&quot;, delay )
F8::RepeatPressBlind( &quot;F8&quot;, delay )

*1::RepeatPressBlind( &quot;1&quot;, delay )
*2::RepeatPressBlind( &quot;2&quot;, delay )
*3::RepeatPressBlind( &quot;3&quot;, delay )
*4::RepeatPressBlind( &quot;4&quot;, 10 )
*5::RepeatPressBlind( &quot;5&quot;, delay )
*6::RepeatPressBlind( &quot;6&quot;, delay )
*7::RepeatPressBlind( &quot;7&quot;, delay )
; *8::RepeatPressBlind( &quot;8&quot;, delay )
; *9::RepeatPressBlind( &quot;9&quot;, delay )
; *0::RepeatPressBlind( &quot;0&quot;, delay )

*q::RepeatPressBlind( &quot;q&quot;, delay )
; *s::RepeatPressBlind( &quot;s&quot;, delay )
*e::RepeatPressBlind( &quot;e&quot;, delay )

*r::RepeatPressBlind( &quot;r&quot;, delay )
*t::RepeatPressBlind( &quot;t&quot;, 160 )
*y::RepeatPressBlind( &quot;y&quot;, delay )

*f::RepeatPressBlind( &quot;f&quot;, delay )
*g::RepeatPressBlind( &quot;g&quot;, delay )
*h::RepeatPressBlind( &quot;h&quot;, delay )

*z::RepeatPressBlind( &quot;z&quot;, delay )
*x::RepeatPressBlind( &quot;x&quot;, delay )
*c::RepeatPressBlind( &quot;c&quot;, delay )
*v::RepeatPressBlind( &quot;v&quot;, delay )
*b::RepeatPressBlind( &quot;b&quot;, delay )
; *n::RepeatPressBlind( &quot;n&quot;, delay )</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sirusianin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=45262</uri>
			</author>
			<updated>2026-01-07T22:59:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=163014#p163014</id>
		</entry>
</feed>
