<?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=5764&amp;type=atom" />
	<updated>2011-05-02T04:32:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5764</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Убрать задержку горячей клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48007#p48007" />
			<content type="html"><![CDATA[<p>Спасибо всем.<br />Я решил проблему по другому: &quot;вручную&quot; создал горячую клавишу через таймер.</p><br /><div class="codebox"><pre><code>SetTimer, KeyX, 1

KeyX:
if GetKeyState(&quot;x&quot;, &quot;P&quot;)
{
***************
**************
Исполняемый код
***************
***************
}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[G0r]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26621</uri>
			</author>
			<updated>2011-05-02T04:32:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48007#p48007</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Убрать задержку горячей клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48002#p48002" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>G0r пишет:</cite><blockquote><p>Подскажите, как это сделать?</p></blockquote></div><p>Можно попробовать воспользоваться таймером, но успех зависит от того, какой код в цикле.<br /></p><div class="codebox"><pre><code>vk58::   ; x
   if !key
   {
      SetTimer, Timer, -10
      key = 1
   }
   Return
   
vk58 Up:: key =

Timer:
   While GetKeyState(&quot;vk58&quot;, &quot;P&quot;)
   {
      ; здесь код
      Sleep, 10  ; меньшее значение будет приравнено к 10
   }
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-05-01T21:24:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48002#p48002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Убрать задержку горячей клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=47990#p47990" />
			<content type="html"><![CDATA[<p>Можно попробовать так:</p><div class="codebox"><pre><code>vk58:: ; x
While GetKeyState(&quot;vk58&quot;, &quot;P&quot;)
   {
      ; Исполняемый код
   }
Sleep, 10 ; малое значение может вызывать притормаживания, да и смысла нет в значении 1, тогда уж без него, хотя... (имхо)
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-05-01T17:28:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=47990#p47990</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Убрать задержку горячей клавиши]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=47962#p47962" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Такая проблема:<br />При длительном зажатии горячей клавиши, ее команды сначала выполняются 1 раз, затем идет секундная пауза, потом они выполняются циклично без остановок до отпуска клавиши.<br />Нужно вот это секундную паузу убрать, что-бы выполнение сразу переходило в цикл.</p><p>Пробовал сделать так:<br /></p><div class="codebox"><pre><code>x::
loop
{
      if GetKeyState(&quot;x&quot;, &quot;P&quot;)
      {
            ***************
            ***************
            Исполняемый код
            ***************
            ***************
      }
      Else
      {
            Break
      }

      Sleep, 1
}
Return</code></pre></div><p>Но такой способ прерывает основной поток программы.</p><p>Подскажите, как это сделать?</p>]]></content>
			<author>
				<name><![CDATA[G0r]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26621</uri>
			</author>
			<updated>2011-04-30T11:06:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=47962#p47962</id>
		</entry>
</feed>
