<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: #IF в Class]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14521&amp;type=atom" />
	<updated>2019-01-31T20:45:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14521</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131847#p131847" />
			<content type="html"><![CDATA[<p>Я про WH_KEYBOARD_LL в SetWindowsHookEx.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-01-31T20:45:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131847#p131847</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131840#p131840" />
			<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>2019-01-31T18:19:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131840#p131840</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131839#p131839" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>С директивой понятно что ничего не поделаешь, но периодически раздражает</p></blockquote></div><p>Что мешает реализовать ее механизм самостоятельно?</p><p>Или так тоже непонятно? <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-31T18:17:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131839#p131839</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131836#p131836" />
			<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>2019-01-31T18:00:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131836#p131836</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131835#p131835" />
			<content type="html"><![CDATA[<p>Не понял что вы не поняли. Если у вас есть условие, вы можете сами включать и отключать хоткеи, не отдавая это на откуп магии #If.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-31T17:58:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131835#p131835</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131753#p131753" />
			<content type="html"><![CDATA[<p>Не очень понял что вы имели ввиду.<br />Вопрос в том, как задать условие для Hotkey в методе класса используя экземпляр, а не сам класс.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-01-29T19:37:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131753#p131753</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131719#p131719" />
			<content type="html"><![CDATA[<p>Ну директива ведь не какая-то там магия, можно и самостоятельно вкл/откл хоткеи, вычисляя условие по хуку/таймеру/вызову метода.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-29T07:18:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131719#p131719</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131718#p131718" />
			<content type="html"><![CDATA[<p>Запутался на ночь глядя. Вызываться по ссылке из ObjBindMethod будет конечно Method3. А Method2, да, он из глобального контекста. <br />С директивой понятно что ничего не поделаешь, но периодически раздражает что для Hotkey IF, в принципе требуется наличие директивы с таким же условием.<br />И в случае глобального контекста нельзя будет просто изменить название класса.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-01-29T06:36:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131718#p131718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131715#p131715" />
			<content type="html"><![CDATA[<p>Так не надо его вызывать из глобального контекста. Method2 будет вызываться экземпляром по ссылке из ObjBindMethod, и тут уже легко понять кто вызывает этот метод.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-01-28T23:08:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131715#p131715</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131714#p131714" />
			<content type="html"><![CDATA[<p>Вот именно, у экземпляра Method2() может возвращать иное значение, чем чем вызов этого же метода из глобального контекста (глобальный экземпляр, который не требует создания с помощью new).<br />Нужно было бы использовать <em>#IF <span style="color: red">this</span>.Method2()</em>, а это невозможно потому что this не существует в глобальном контексте.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-28T23:03:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131714#p131714</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131713#p131713" />
			<content type="html"><![CDATA[<p>Почему global, если в качестве условия выступает метод класса (8 пост). И это пример, на практике Method1 будет вызываться экземпляром.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-01-28T22:39:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131713#p131713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131712#p131712" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>MsgBox #IF work in class!!!</p></blockquote></div><p>#IF work in global!!!</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-28T22:32:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131712#p131712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131711#p131711" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>stealzy пишет:</cite><blockquote><p>нужна переменная посредник.</p></blockquote></div><p>В случаях когда часто используется в коде, проще сделать функцию.<br />Из коробки не очень очевидно, забываешь периодически. Но их часто нужно сохранять, если надо потом отключить таймер или хоткей.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-01-28T21:54:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131711#p131711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131710#p131710" />
			<content type="html"><![CDATA[<p>С SetTimer та же история, нужна переменная посредник.<br /></p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Хочется упаковать именно так</p></blockquote></div><p>Будет вызывать ложное ощущение что #IF использует локальный контекст, тогда как работает в глобальном. Или что исполняется по вызову метода.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-28T21:44:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131710#p131710</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: #IF в Class]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=131709#p131709" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>ClassName.Method1()
x := 1
#IF x
#IF

Class ClassName {
	Method1() {
		Hotkey, IF, x  
		t := ObjBindMethod(this, &quot;_Method3&quot;)
		Hotkey, 1, % t, On
		Hotkey, IF
	}
	Method2() {
		Return 1
	}
	_Method3() {
		MsgBox #IF work in class!!!
	}
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-01-28T21:40:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=131709#p131709</id>
		</entry>
</feed>
