<?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>http://forum.script-coding.com/viewtopic.php?id=7163</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=7163&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?».]]></description>
		<lastBuildDate>Wed, 02 May 2012 20:32:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59942#p59942</link>
			<description><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>...по поводу первой части замечания не совсем понял.</p></blockquote></div><p>Отнюдь, это не замечание, просто хотел сказать, что <a href="http://forum.script-coding.com/viewtopic.php?pid=59868#p59868">тот</a> код </p><div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>... — очень древний <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Grey)]]></author>
			<pubDate>Wed, 02 May 2012 20:32:15 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59942#p59942</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59939#p59939</link>
			<description><![CDATA[<p>You&#039;re welcome. <img src="//forum.script-coding.com/img/smilies/cool.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 02 May 2012 18:49:56 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59939#p59939</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59938#p59938</link>
			<description><![CDATA[<p>Я даже не знаю, как выразить мою благодарность. <br />Это прекрасно! Спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Wed, 02 May 2012 18:41:21 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59938#p59938</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59937#p59937</link>
			<description><![CDATA[<p>Разбирайся:<br /></p><div class="codebox"><pre><code>EnterCnt =
^Enter::
  EnterCnt++                     ; Count Ctrl-Enter&#039;s
return
^vk42::                            ; &quot;b&quot; или &quot;и&quot;
  EnterCnt++                     ; Count Ctrl-Enter&#039;s
return
~CTRL Up::                       ; Ctrl released: Stop counting
  IfEqual EnterCnt,,return       ; Exit if no Ctrl-Enter was pressed yet
  GoSub Action
return

Action:
a := A_PriorHotkey
c := A_ThisHotKey
if (A_PriorHotkey = &quot;^vk42&quot;)
        {
        Msgbox % a &quot;      &quot; c
         EnterCnt =  
        Return
        }
  Cnt := EnterCnt
  EnterCnt =                     ; Reset while MsgBox is still active
  MsgBox Number of Ctrl-Enter&#039;s is %Cnt%
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 02 May 2012 18:33:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59937#p59937</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59936#p59936</link>
			<description><![CDATA[<p>Раз пошла такая пьянка <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Пытаюсь адаптировать код, чтобы он обрабатывал два (и более) хоткеев на одном модификаторе. <br />Уж больно нравится мне ситуация, когда срабатывание происходит по отжатии модификатора. <br />Не жалую я всякие SetTimer <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Так вот, код:</p><div class="codebox"><pre><code>EnterCnt =

^Enter::
  EnterCnt++                     ; Count Ctrl-Enter&#039;s
return

^b::
  EnterCnt++                     ; Count Ctrl-Enter&#039;s
return

~CTRL Up::                       ; Ctrl released: Stop counting
  IfEqual EnterCnt,,return       ; Exit if no Ctrl-Enter was pressed yet
  GoSub Action
return


Action:
    if (A_ThisHotKey = ^b)
        {
        Msgbox b
         EnterCnt =  
        Return
        }
  Cnt := EnterCnt
  EnterCnt =                     ; Reset while MsgBox is still active
  MsgBox Number of Ctrl-Enter&#039;s is %Cnt%
return</code></pre></div><p>Условие if в action не работает. Пробовал и A_PriorHotKey во всевозможных комбинациях - ноль. <br />Как правильно задать условие, что есть ^Enter = одно, а если ^b = другое?</p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Wed, 02 May 2012 18:16:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59936#p59936</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59933#p59933</link>
			<description><![CDATA[<p>switch() — очень древний <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Wed, 02 May 2012 17:21:46 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59933#p59933</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59931#p59931</link>
			<description><![CDATA[<p>Насчет <strong>Return</strong> согласен, по поводу первой части замечания не совсем понял.</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 02 May 2012 17:00:26 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59931#p59931</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59927#p59927</link>
			<description><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>...каскад из <strong>if... else if...</strong> не самый красивый вариант.</p></blockquote></div><p>Этому каскаду <em>сто лет в обед</em>, Return во второй строке лишний.</p>]]></description>
			<author><![CDATA[null@example.com (Grey)]]></author>
			<pubDate>Wed, 02 May 2012 16:27:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59927#p59927</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59902#p59902</link>
			<description><![CDATA[<p>&quot;Раз пошла такая пьянка&quot; (С) <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />, вставлю свои&nbsp; 5 копеек. Имхо, каскад из <strong>if... else if...</strong> не самый красивый вариант.<br />Вот моя вариация на тему скрипта от <strong>Grey</strong>:<br /></p><div class="codebox"><pre><code>Keys := {31: &quot;First&quot;, 32: &quot;Second&quot;, 33: &quot;Third&quot;, 34: &quot;Fourth&quot;, 35: &quot;Fifth&quot;}
return
vk31::
vk32::
vk33::
vk34::
vk35::TrayTip,, % A_ThisHotkey
 
!vk48::
   KeyWait, vk48
   SetTimer, countervk48, -500
   Return
 
countervk48:
   ch := SubStr(A_ThisHotkey, 3)
   if Keys.HasKey(ch)
      msg(Keys[ch])
   Return
 
msg(msgtext)
{
   MsgBox,,, % msgtext &quot; action&quot;, 1
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 02 May 2012 08:14:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59902#p59902</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59899#p59899</link>
			<description><![CDATA[<p>Ого! Круто. Буду тестить. Приведенный мной вариант плох тем, что на него на шару не повесишь несколько хоткеев с одним модификатором. А как он работает я понимаю где-то только на две трети <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> В общем, спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Wed, 02 May 2012 06:16:57 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59899#p59899</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59868#p59868</link>
			<description><![CDATA[<p>Есть ещё варианты <em>до кучи</em>:</p><div class="codebox"><pre><code>vk31::
vk32::
vk33::
vk34::
vk35::TrayTip,, % A_ThisHotkey

!vk48::
   KeyWait, vk48
   SetTimer, countervk48, -500
   Return

countervk48:
   If SubStr(A_ThisHotkey, 3)=&quot;31&quot;
      msg(&quot;First&quot;)
   Else If SubStr(A_ThisHotkey, 3)=&quot;32&quot;
      msg(&quot;Second&quot;)
   Else If SubStr(A_ThisHotkey, 3)=&quot;33&quot;
      msg(&quot;Third&quot;)
   Else If SubStr(A_ThisHotkey, 3)=&quot;34&quot;
      msg(&quot;Fourth&quot;)
   Else If SubStr(A_ThisHotkey, 3)=&quot;35&quot;
      msg(&quot;Fifth&quot;)
   ; etc.
   Return

msg(msgtext)
{
   MsgBox,,, % msgtext &quot; action&quot;, 1
}</code></pre></div><div class="codebox"><pre><code>!vk48::
   KeyWait, vk48
   SetTimer, countervk48, -500
   Return

countervk48:
   If A_PriorKey=1
      msg(&quot;First&quot;)
   Else If A_PriorKey=2
      msg(&quot;Second&quot;)
   Else If A_PriorKey=3
      msg(&quot;Third&quot;)
   Else If A_PriorKey=4
      msg(&quot;Fourth&quot;)
   Else If A_PriorKey=5
      msg(&quot;Fifth&quot;)
   ; etc.
   Return

msg(msgtext)
{
   MsgBox,,, % msgtext &quot; action&quot;, 1
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Grey)]]></author>
			<pubDate>Mon, 30 Apr 2012 21:41:12 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59868#p59868</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59863#p59863</link>
			<description><![CDATA[<div class="codebox"><pre><code>!vk48:: ; alt+h
   starttimevk48:=A_TickCount
   KeyWait, vk48
   vk48i++
   SetTimer, % (bool:=A_TickCount-starttimevk48&gt;500)
   ? &quot;actionxxvk48&quot;:&quot;countervk48&quot;, % &quot;-&quot;(bool ? 0:300)
   Return

countervk48:
   If vk48i=1
      SetTimer, action1vk48, -0
   Else If vk48i=2
      SetTimer, action2vk48, -0
   Else If vk48i=3
      SetTimer, action3vk48, -0
   ; etc.
   vk48i:=
   Return

action1vk48:
   msg(&quot;Single&quot;)
   Return
action2vk48:
   msg(&quot;Double&quot;)
   Return
action3vk48:
   msg(&quot;Triple&quot;)
   Return
actionxxvk48:
   msg(&quot;Pressed &amp; released&quot;)
   Return

msg(msgtext)
{
   MsgBox,,, % msgtext &quot; click&quot;, 1
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Grey)]]></author>
			<pubDate>Mon, 30 Apr 2012 20:11:01 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59863#p59863</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59851#p59851</link>
			<description><![CDATA[<p>Еще один вариант в копилку <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />По ссылке весьма продвинутый вариант, в котором нажатий может быть сколько угодно - 1, 2, 3 и т.д. (и всё это с зажатым модификатором)</p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Mon, 30 Apr 2012 16:59:50 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59851#p59851</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59846#p59846</link>
			<description><![CDATA[<p>По неправильно оформленной ссылке не ходил, но двойное нажатие это примерно так:<br /></p><div class="codebox"><pre><code>DoublePress()
{
    static firstPress
    return firstPress := (A_ThisHotkey == A_PriorHotkey &amp;&amp; !firstPress &amp;&amp; A_TimeSincePriorHotkey &lt;= 400)
}

$!h::
If DoublePress()
   MsgBox Bingo
Else
   Send !{h}
Return</code></pre></div><p>При «двойном клике» естественно выполнится минимум первый из двух.</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Mon, 30 Apr 2012 12:03:58 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59846#p59846</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=59841#p59841</link>
			<description><![CDATA[<p>Нашел решение здесь:</p><p><a href="http://www.autohotkey.com/community/viewtopic.php?f=1&amp;t=2977&amp;hilit=double+press+with">http://www.autohotkey.com/community/vie … press+with</a></p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Mon, 30 Apr 2012 08:53:05 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=59841#p59841</guid>
		</item>
	</channel>
</rss>
