<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9716&amp;type=atom" />
	<updated>2015-01-06T17:34:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9716</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90089#p90089" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong><br />Спасибо большое.</p>]]></content>
			<author>
				<name><![CDATA[Esc]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32797</uri>
			</author>
			<updated>2015-01-06T17:34:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90089#p90089</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90084#p90084" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>loop
{
    IfWinNotExist, ahk_exe JPEGView.exe
        n :=  b := v := &quot;&quot;
    sleep, 100
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2015-01-06T16:57:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90084#p90084</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90082#p90082" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>loop
{
   IfWinNotExist, ahk_exe JPEGView.exe
      n = 
      b = 
      v =
   sleep, 100
}</code></pre></div><p>Подскажите пожалуйста, если установить вот такой код, то у токенов b и v не работают вторые горячие клавиши, как правильно добавить множество токенов?</p>]]></content>
			<author>
				<name><![CDATA[Esc]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32797</uri>
			</author>
			<updated>2015-01-06T16:38:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90082#p90082</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84356#p84356" />
			<content type="html"><![CDATA[<p>Можно в начале скрипта сделать проверку:<br /></p><div class="codebox"><pre><code>loop
{
   IfWinNotExist, твое окно
      n =
   sleep, 100
}</code></pre></div><div class="quotebox"><blockquote><p>Оказалось у меня ошибка в названии окна, &quot; - JPEGView&quot; не работает, &quot;ahk_exe JPEGView.exe&quot; работает.</p></blockquote></div><p>Это зависит от SetTitleMatchMode.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-06-29T21:09:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84356#p84356</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84353#p84353" />
			<content type="html"><![CDATA[<p>Благодаря <strong>Tooltip</strong>-у обнаружил небольшую проблему, к примеру, запустили целевую программу, нажали ^LButton - послалась клавиша <strong>R</strong>, вышли из программы и заново запустили, пошлется клавиша <strong>E</strong>, а нужно опять <strong>R</strong>. Как бы сделать так, чтобы скрипт замечал, когда программа закрывается и обнулял состояние? <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-29T20:10:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84353#p84353</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84348#p84348" />
			<content type="html"><![CDATA[<p><strong>Drugoy</strong><br />Оказалось у меня ошибка в названии окна, &quot;<strong> - JPEGView</strong>&quot; не работает, &quot;<strong>ahk_exe JPEGView.exe</strong>&quot; работает. Спасибо за информацию о токенах, теперь понял зачем. Зато прогресс, разобрался, как сделать <strong>Tooltip</strong> с информацией на каждый клик.</p><br /><div class="codebox"><pre><code>#IfWinActive, ahk_exe JPEGView.exe
   {
   ^LButton::
if (n != 1)
{
   Send r
   n = 1
   #Persistent
   ToolTip, Вы нажали клавишу R
   SetTimer, RemoveToolTip1, 2000
   return
   RemoveToolTip1:
   SetTimer, RemoveToolTip1, Off
   ToolTip
   return
}
Else
{
   Send e
   n =
   #Persistent
   ToolTip, Вы нажали клавишу E
   SetTimer, RemoveToolTip2, 2000
   return
   RemoveToolTip2:
   SetTimer, RemoveToolTip2, Off
   ToolTip
   return
}
return
}

#IfWinActive, ahk_exe JPEGView.exe
   {
   ^Q::
if (b != 1)
{
   Send t
   b = 1
}
Else
{
   Send e
   b =
}
return
}

#IfWinActive, ahk_exe JPEGView.exe
   {
   ^W::
if (v != 1)
{
   Send n
   v = 1
}
Else
{
   Send c
   v =
}
return
}

#IfWinActive, ahk_exe PaintDotNet.exe
   {
   ^LButton::
if (c != 1)
{
   Send r
   c = 1
}
Else
{
   Send e
   c =
}
return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-29T19:40:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84348#p84348</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84345#p84345" />
			<content type="html"><![CDATA[<p>Работает (но, видимо, не так, как вам хочется). Токены для разных окон и разных хоткеев надо использовать разные, а у вас везде один и тот же &quot;n&quot;.</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2014-06-29T16:20:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84345#p84345</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84303#p84303" />
			<content type="html"><![CDATA[<p>Подскажите пожалуйста, можно ли в один скрипт включать множество таких переназначений? Вот так не работает:</p><div class="codebox"><pre><code>#IfWinActive, - JPEGView
#IfWinActive, - paint.net
   {
   ^LButton::
if (n != 1)
{
   Send r
   n = 1
}
Else
{
   Send e
   n =
}
return
}

#IfWinActive, - JPEGView
   {
   ^Q::
if (n != 1)
{
   Send t
   n = 1
}
Else
{
   Send e
   n =
}
return
}

#IfWinActive, - JPEGView
   {
   ^W::
if (n != 1)
{
   Send n
   n = 1
}
Else
{
   Send c
   n =
}
return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-27T15:50:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84303#p84303</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84011#p84011" />
			<content type="html"><![CDATA[<p>Получилось, но теперь нужно сделать OSD на каждый клик со своей надписью, а вот это уже непонятно как встроить в код.</p><div class="codebox"><pre><code>#IfWinActive ahk_class Notepad++
Space::
if (n != 1)
{
   Send ^x
   n = 1
}
Else
{
   Send ^v
   n =
}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-20T05:16:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84011#p84011</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84004#p84004" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Спасибо, попробую разобраться, не там читал. А в соседней теме не могли бы помочь?<br /><a href="http://forum.script-coding.com/viewtopic.php?id=9713">http://forum.script-coding.com/viewtopic.php?id=9713</a></p>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-19T18:53:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84004#p84004</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84001#p84001" />
			<content type="html"><![CDATA[<p><a href="http://www.script-coding.com/AutoHotkey/IfWinActive.html">http://www.script-coding.com/AutoHotkey … ctive.html</a><br /><a href="http://www.script-coding.com/AutoHotkey/Send.html">http://www.script-coding.com/AutoHotkey/Send.html</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-06-19T18:03:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84001#p84001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=84000#p84000" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />А почему msgbox? Радует, реализовать это можно, но как сделать, чтобы скрипт работал только когда целевая программа на переднем плане и как посылать клавиши вместо msgbox?</p>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-19T18:00:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=84000#p84000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=83999#p83999" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>f11::
if (n != 1)
{
   msgbox, 1
   n = 1
}
Else
{
   msgbox, 2
   n =
}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-06-19T17:49:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=83999#p83999</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Возможно ли, назначить 2 горячих клавиши на одну и зациклить?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=83998#p83998" />
			<content type="html"><![CDATA[<p>Возможно ли, <strong>в определенном приложении</strong>, назначить 2 горячих клавиши на одну поочередно, например, запустил LibreOffice, первое нажатие на Space посылает Ctrl+X, второе Ctrl+V, третье, опять Ctrl+X, т.е. <strong>по кругу</strong>.</p>]]></content>
			<author>
				<name><![CDATA[Ed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32363</uri>
			</author>
			<updated>2014-06-19T17:36:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=83998#p83998</id>
		</entry>
</feed>
