<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: два #IfWinActive срабатывание скрипта, по обоим условиям]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10180&amp;type=atom" />
	<updated>2014-11-23T16:37:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10180</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: два #IfWinActive срабатывание скрипта, по обоим условиям]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=88598#p88598" />
			<content type="html"><![CDATA[<p>Прочитай статью <a href="http://www.script-coding.com/AutoHotkey/Variables.1.0.46.07.html">Переменные и выражения</a>, в части &quot;Операторы в выражениях&quot; есть и эта конструкция, <em>тернарный оператор</em>.</p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2014-11-23T16:37:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=88598#p88598</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: два #IfWinActive срабатывание скрипта, по обоим условиям]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=88597#p88597" />
			<content type="html"><![CDATA[<p>Irbis спасибо.<br /></p><div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>Для чего столько повторяющегося на 95% кода? Тем более что <strong>#IfWinActive</strong> тут и не нужен.</p></blockquote></div><p>Как видел задачу, так и записал.<br />А это я просто не понимаю:<br /></p><div class="codebox"><pre><code>Send % WinActive(&quot;Speed Dial&quot;)  ? &quot;{sc41}&quot; : &quot;^{vk57}&quot;</code></pre></div><p>вижу что она делает, но воссоздать подобную пока, что не могу.</p>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2014-11-23T15:34:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=88597#p88597</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: два #IfWinActive срабатывание скрипта, по обоим условиям]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=88582#p88582" />
			<content type="html"><![CDATA[<p>Для чего столько повторяющегося на 95% кода? Тем более что <strong>#IfWinActive</strong> тут и не нужен.<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoTrayIcon
SetTitleMatchMode, 2
Return
XButton1::
{
    KeyWait, %A_ThisHotkey%
    KeyWait, %A_ThisHotkey%, D T0.2
    If ErrorLevel
        {
        Send % WinActive(&quot;Speed Dial&quot;)  ? &quot;{sc41}&quot; : &quot;^{vk57}&quot;
        }
    Else
        {
        Sleep 200
        GetKeyState, state, XButton1, P
        if state = D
            {
            Send ^+{SC014} ; ctrl + shift + T если двойной клик и удерживаеться кнопка
            }
        else
            {
            Send ^{SC014} ; ctrl + T если двойной клик
            }
        }
    KeyWait, %A_ThisHotkey%
    Return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2014-11-23T08:33:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=88582#p88582</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: два #IfWinActive срабатывание скрипта, по обоим условиям]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=88578#p88578" />
			<content type="html"><![CDATA[<p>Скрипт для браузера:<br /> XButton1<br />действия для окна &quot;Speed Dial&quot;<br />1- одиночное нажатие посылает F7<br />2- двойное нажатие посылает ctrl + T<br />3- двойное нажатие и удержание кнопки ctrl + shift + T</p><p>действия в любом окне<br />1- одиночное нажатие посылает ctrl + W<br />2- двойное нажатие посылает ctrl + T<br />3- двойное нажатие и удержание кнопки ctrl + shift + T</p><p>Проблема:<br />при двойном нажатии и удержании XButton1 в окне Speed Dial<br />срабатывает и ctrl +shift+T (как и должно быть) и ctrl+W (первое условие на одиночное нажатие во всех окнах)</p><div class="codebox"><pre><code>#SingleInstance Force
#NoTrayIcon
SetTitleMatchMode, 2

#IfWinActive Speed Dial
XButton1::
{
    ToolTip
    KeyWait, %A_ThisHotkey%
    KeyWait, %A_ThisHotkey%, D T0.1
    If ErrorLevel
        {
            Send {sc41} ; F7 если одиночный клик
        }
    Else
        {
        Sleep 200
        GetKeyState, state, XButton1, P
        if state = D
            {
            Send ^+{SC014} ; ctrl + shift + T если двойной клик и удерживаеться кнопка
            }
        else
            {
            Send ^{SC014} ; ctrl + T если двойной клик
            }
        }
    KeyWait, %A_ThisHotkey%
    Return
}
#IfWinActive
XButton1::
{
    KeyWait, %A_ThisHotkey%
    KeyWait, %A_ThisHotkey%, D T0.1
    If ErrorLevel
        {
        Send ^{vk57} ; ctrl + W если одиночный клик
        }
    Else
        {
        Sleep 200
        GetKeyState, state, XButton1, P
        if state = D
            {
            Send ^+{SC014} ; ctrl + shift + T если двойной клик и удерживаеться кнопка
            }
        else
            {
            Send ^{SC014} ; ctrl + T если двойной клик
            }
        }
    KeyWait, %A_ThisHotkey%
    Return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2014-11-22T22:16:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=88578#p88578</id>
		</entry>
</feed>
