<?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=11671&amp;type=atom" />
	<updated>2016-06-06T14:48:40Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11671</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104823#p104823" />
			<content type="html"><![CDATA[<p>Получилось вот так. Поправьте мня, если не так.<br /></p><div class="codebox"><pre><code>	Hkey1 = 1
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hotkey start
Gui, Add, Hotkey, vgam1,
Gui, Add, Button, Default, Save

F1:: Gui, Show, % (c := !c) ? &quot;&quot; : &quot;Hide&quot;
Return

ButtonSave:
	Gui, Submit
	
	IfNotEqual, Lastgam1,, Hotkey, % Lastgam1, off
	Lastgam1 := gam1
	
	if Hkey1 = 0
	Hotkey, % gam1, Off
	if Hkey1 = 1
	Hotkey, % gam1, gamV1, on UseErrorLevel

Return

gamV1:
	MsgBox, Тест 1
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-06T14:48:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104823#p104823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104743#p104743" />
			<content type="html"><![CDATA[<p>Зря вы иронизируете, я прочитал справку про UseErrorLevel, но как применить в контексте не понимаю. Про следующие вопросы, как ни странно я уже спрашивал.<br /></p><div class="codebox"><pre><code>	Hkey1 = 1
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hotkey start
Gui, Add, Hotkey, vgam1,
Gui, Add, Button, Default, Save

F1:: Gui, Show, % (c := !c) ? &quot;&quot; : &quot;Hide&quot;
Return

ButtonSave:
	Gui, Submit
	
	IfNotEqual, Lastgam1,, Hotkey, % Lastgam1, off
	Lastgam1 := gam1
	
	Hotkey, % gam1, gamV1, on UseErrorLevel
	
	if Hkey1 = 0
	Hotkey, % gam1, Off UseErrorLevel
	if Hkey1 = 1
	Hotkey, % gam1, On UseErrorLevel
Return

gamV1:
	MsgBox, Тест 1
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-05T21:29:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104743#p104743</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104741#p104741" />
			<content type="html"><![CDATA[<p>Даже в русской справке написано про параметр <strong>UseErrorLevel</strong>. Следующий вопрос конечно про то, как бы не назначить такое же как уже есть, но и это есть на форуме, поищите получше. Ответ <a href="http://forum.script-coding.com/viewtopic.php?pid=104591#p104591">про другие клавиши</a> тоже есть в виде <a href="http://forum.script-coding.com/viewtopic.php?pid=72549#p72549">костыля</a>.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-06-05T21:12:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104741#p104741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104739#p104739" />
			<content type="html"><![CDATA[<p>А подскажите пожалуйста. Как избавится от ошибки не существующей переменной? Когда сохраняешь пустой хоткей.</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-05T19:23:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104739#p104739</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104735#p104735" />
			<content type="html"><![CDATA[<p>Да, точно, ошибся.</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-05T18:31:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104735#p104735</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104734#p104734" />
			<content type="html"><![CDATA[<p>Не знаю, у меня назначаются те что были до этого выключены.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-06-05T17:18:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104734#p104734</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104732#p104732" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong><br />Спасибо, я об этом не подумал.<br />Возникла ещё одна проблема, даже не проблема, а так неприятность. После переназначения хоткея, старый хоткей выключается, и если вдруг его захочется вернуть обратно, то это не получится сделать до перезапуска скрипта. Есть идеи?</p>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-05T15:45:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104732#p104732</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104718#p104718" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>выключает не измененные хоткеи.</p></blockquote></div><div class="codebox"><pre><code>	Hotkey, % hot1, hotV1, on
	Hotkey, % hot2, hotV2, on</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-06-05T09:20:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104718#p104718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104711#p104711" />
			<content type="html"><![CDATA[<p><strong>yalanne</strong><br />Спасибо. Всё бы ни чего, но после нажатия кнопки сохранить, происходит сохранение (с записью в файл) больше одной переменной. Такой вариант не подходит, он попросту выключает не измененные хоткеи.<br /></p><div class="codebox"><pre><code>Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hotkey start
Gui, Add, Hotkey, vhot1,
Gui, Add, Hotkey, vhot2,
Gui, Add, Button, Default, Save

F1:: Gui, Show, % (c := !c) ? &quot;&quot; : &quot;Hide&quot;
Return

ButtonSave:
	Gui, Submit
	
	IfNotEqual,Lasthot1,,	Hotkey, % Lasthot1, off
	Lasthot1 := hot1
	IfNotEqual,Lasthot2,,	Hotkey, % Lasthot2, off
	Lasthot2 := hot2
	
	Hotkey, % hot1, hotV1
	Hotkey, % hot2, hotV2
Return

hotV1:
	MsgBox, Тест 1
Return
hotV2:
	MsgBox, Тест 2
Return</code></pre></div><p>Пробовал так, тоже всё криво, если повторно задать хоткей, или использовать модификатор.<br /></p><div class="codebox"><pre><code>	hot1 = F2 ;прочитано из файла
	hot2 = F3 ;прочитано из файла
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hotkey start
Gui, Add, Hotkey, vhot1 ghotG1, % hot1
Gui, Add, Hotkey, vhot2 ghotG2, % hot2
Gui, Add, Button, Default, Save

F1:: Gui, Show, % (c := !c) ? &quot;&quot; : &quot;Hide&quot;
Return

hotG1:
	IfNotEqual,Lasthot1,,	Hotkey, % Lasthot1, off
	Lasthot1 := hot1
Return
hotG2:
	IfNotEqual,Lasthot2,,	Hotkey, % Lasthot2, off
	Lasthot2 := hot2
Return

ButtonSave:
	Gui, Submit
	; hot1 записывается в файл
	; hot2 записывается в файл
	Hotkey, % hot1, hotV1
	Hotkey, % hot2, hotV2
Return

hotV1:
	MsgBox, Тест 1
Return
hotV2:
	MsgBox, Тест 2
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-05T01:30:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104711#p104711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104674#p104674" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hotkey start
Gui, Add, Hotkey, vhot1,
Gui, Add, Button, Default, Save

F1:: Gui, Show, % (c := !c) ? &quot;&quot; : &quot;Hide&quot;
Return

ButtonSave:
	Gui, Submit
	
	IfNotEqual,Lasthot1,,	Hotkey, % Lasthot1, off
	Lasthot1 := hot1
	
	Hotkey, % hot1, hotV1
Return

hotV1:
	MsgBox, Тест
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2016-06-04T10:13:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104674#p104674</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Два хоткея в одной переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=104669#p104669" />
			<content type="html"><![CDATA[<p>Добрый день. Проблема в следующем. Есть окно Gui в котором сохраняются хоткеи в переменные. В общем если задать поочередно два хоткея и сохранить, то получим две горячих кнопки, которые не плохо себе работают. Как этого избежать и сделать заменяемый хоткей?<br /></p><div class="codebox"><pre><code>Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Hotkey start
Gui, Add, Hotkey, vhot1,
Gui, Add, Button, Default, Save

F1:: Gui, Show, % (c := !c) ? &quot;&quot; : &quot;Hide&quot;
Return

ButtonSave:
	Gui, Submit
	Hotkey, % hot1, hotV1
Return

hotV1:
	MsgBox, Тест
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Sgy-x2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32753</uri>
			</author>
			<updated>2016-06-04T06:28:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=104669#p104669</id>
		</entry>
</feed>
