<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=7163&amp;type=atom" />
	<updated>2012-05-02T20:32:15Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=7163</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59942#p59942" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-05-02T20:32:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59942#p59942</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59939#p59939" />
			<content type="html"><![CDATA[<p>You&#039;re welcome. <img src="//forum.script-coding.com/img/smilies/cool.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-05-02T18:49:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59939#p59939</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59938#p59938" />
			<content type="html"><![CDATA[<p>Я даже не знаю, как выразить мою благодарность. <br />Это прекрасно! Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Kamagi]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27024</uri>
			</author>
			<updated>2012-05-02T18:41:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59938#p59938</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59937#p59937" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-05-02T18:33:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59937#p59937</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59936#p59936" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Kamagi]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27024</uri>
			</author>
			<updated>2012-05-02T18:16:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59936#p59936</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59933#p59933" />
			<content type="html"><![CDATA[<p>switch() — очень древний <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-05-02T17:21:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59933#p59933</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59931#p59931" />
			<content type="html"><![CDATA[<p>Насчет <strong>Return</strong> согласен, по поводу первой части замечания не совсем понял.</p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-05-02T17:00:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59931#p59931</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59927#p59927" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>...каскад из <strong>if... else if...</strong> не самый красивый вариант.</p></blockquote></div><p>Этому каскаду <em>сто лет в обед</em>, Return во второй строке лишний.</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-05-02T16:27:45Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59927#p59927</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59902#p59902" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-05-02T08:14:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59902#p59902</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59899#p59899" />
			<content type="html"><![CDATA[<p>Ого! Круто. Буду тестить. Приведенный мной вариант плох тем, что на него на шару не повесишь несколько хоткеев с одним модификатором. А как он работает я понимаю где-то только на две трети <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> В общем, спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Kamagi]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27024</uri>
			</author>
			<updated>2012-05-02T06:16:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59899#p59899</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59868#p59868" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-04-30T21:41:12Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59868#p59868</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59863#p59863" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-04-30T20:11:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59863#p59863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59851#p59851" />
			<content type="html"><![CDATA[<p>Еще один вариант в копилку <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />По ссылке весьма продвинутый вариант, в котором нажатий может быть сколько угодно - 1, 2, 3 и т.д. (и всё это с зажатым модификатором)</p>]]></content>
			<author>
				<name><![CDATA[Kamagi]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27024</uri>
			</author>
			<updated>2012-04-30T16:59:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59851#p59851</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59846#p59846" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-04-30T12:03:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59846#p59846</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Модификатор + одиночной нажатие или двойное нажатие - возможно?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=59841#p59841" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Kamagi]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27024</uri>
			</author>
			<updated>2012-04-30T08:53:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=59841#p59841</id>
		</entry>
</feed>
