<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Сочетание клавиш через config.ini]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=13503</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=13503&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Сочетание клавиш через config.ini».]]></description>
		<lastBuildDate>Mon, 05 Mar 2018 18:35:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123937#p123937</link>
			<description><![CDATA[<p><strong>Oomniq</strong><br />Согласен, не всерьез, но пример то зачитан.</p>]]></description>
			<author><![CDATA[null@example.com (shahlik002)]]></author>
			<pubDate>Mon, 05 Mar 2018 18:35:57 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123937#p123937</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123935#p123935</link>
			<description><![CDATA[<p><strong>shahlik002</strong><br />Мне кажется, Inputbox не очень подходит для задания горячей клавиши.</p><p><strong>mtc_err</strong><br />Написал вот такой вариант на скорую руку без возможности нормально проверить:<br /></p><div class="codebox"><pre><code>ini2=%A_WorkingDir%\название файла.ini
none:=									;переменная для страховки от ошибок
iniread,Screenshot,%ini2%,Название группы клавиш,Имя1			;чтение из существующего файла
if (Screenshot=&quot;error&quot; or Screenshot=none)
	Screenshot:=&quot;sc42&quot;						;сверка на наличие ошибок - если переменная горячей клавиши ничего не содержит или вызывает ошибку при чтении, насильно назначает её на F8
	else
	Screenshot:=GetHotkeySC(Screenshot)				;в остальных случаях читает её из файла

Gui, set:Add, button, x50 y30 w125 h23 center gnichego, Применить
Gui, set:Add, Text, x5 y79 w250 h15 +BackgroundTrans, Клавиша:
Gui, set:Add, Hotkey, x240 y75 w80 h20 vcisScreenshot, %Screenshot%
Gui, set:Add, button, x2 y100 w125 h23 center, Сохранить
Gui, set:Add, button, x200 y100 w120 h23 center, Закрыть настройки
Gui, set:Show, w322 h125, %AppName% » Настройки
Hotkey, % Screenshot, on, UseErrorLevel
Hotkey, % Screenshot, work, UseErrorLevel					;здесь горячая клавиша привязывается к процедуре
return

work:
Screenshot := (GUISys.isScreenshot)
SendChat(&quot;/time&quot;)
Sleep 250
SendInput {%Screenshot%}
return

nichego:
Hotkey, % Screenshot, off, UseErrorLevel					;на случай если происходит смена горячей клавиши отключает функционал текущей
GuiControlGet,Screenshot,,cisscreenshot
IniWrite,%Screenshot%,%ini2%,Название группы клавиш,Имя1
Hotkey, % Screenshot, on, UseErrorLevel
Hotkey, % Screenshot, work, UseErrorLevel
return

GetHotkeySC(hotkey)  {
   RegExMatch(hotkey, &quot;([!^+#]*)(.*)&quot;, key)
   Return key1 . ((StrLen(key2) = 1 || InStr(key2, &quot;Num&quot;)) ? Format(&quot;sc{:X}&quot;, GetKeySC(key2)) : key2)
}
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Oomniq)]]></author>
			<pubDate>Mon, 05 Mar 2018 17:32:12 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123935#p123935</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123934#p123934</link>
			<description><![CDATA[<p><strong>shahlik002</strong> спасибо)</p>]]></description>
			<author><![CDATA[null@example.com (mtc_err)]]></author>
			<pubDate>Mon, 05 Mar 2018 17:29:21 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123934#p123934</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123932#p123932</link>
			<description><![CDATA[<div class="codebox"><pre><code>IniRead ,key,hotkey.ini,1,key,Space
if (key=f1 or key=)
	key=space
MsgBox % key
Hotkey,%key%,label
return
Label:
indx++
ToolTip % indx
return

f1::
InputBox,key2
if key=f2
{
	MsgBox nea
	return
}
IniWrite,%key2%,hotkey.ini,1,key
Reload

Esc::
IniWrite,%key2%,hotkey.ini,1,key
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (shahlik002)]]></author>
			<pubDate>Mon, 05 Mar 2018 17:04:20 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123932#p123932</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123895#p123895</link>
			<description><![CDATA[<p><strong>ypppu</strong> напишите пожалуйста пример. Не совсем понял.</p>]]></description>
			<author><![CDATA[null@example.com (mtc_err)]]></author>
			<pubDate>Sat, 03 Mar 2018 14:29:20 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123895#p123895</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123889#p123889</link>
			<description><![CDATA[<p>Сохраняет настрйки команда IniWrite: <span style="color: navy"><strong>IniWrite, Value, Filename, Section, Key</strong></span>.</p><p>Считывает настройки команда IniRead: <span style="color: navy"><strong>IniRead, OutputVar, Filename, Section, Key [, Default]</strong></span>.</p><p>Включает/выключает горячие клавиши команда Hotkey: <span style="color: navy"><strong>Hotkey, KeyName [, Label, Options]</strong></span>.</p><p>Чтобы введённую горячую клавишу сохранить в переменную vcisScreenshot, используйте команду GUI, Submit.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Sat, 03 Mar 2018 10:11:03 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123889#p123889</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Сочетание клавиш через config.ini]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123887#p123887</link>
			<description><![CDATA[<p>Приветствую. Такой вопрос: как сделать изменения клавиш через config.ini?</p><p>Например: чтобы в поля ввода &lt;&lt;Hotkey&gt;&gt; (назначение клавиш) - сохраняло в config.ini, и соответственно содействовало назначенное в скрипте.</p><div class="codebox"><pre><code>
Gui, set:Add, Text, x5 y79 w250 h15 +BackgroundTrans, Клавиша:
Gui, set:Add, Hotkey, x240 y75 w80 h20 vcisScreenshot, %Screenshot%
Gui, set:Add, button, x2 y100 w125 h23 center gsaveSetting, Сохранить
Gui, set:Add, button, x200 y100 w120 h23 center gsetGuiClose, Закрыть настройки
Gui, set:Show, Hide w322 h125, %AppName% » Настройки

(sc42):: ; Тут нужно изменять клавишу через config.ini
Screenshot := (GUISys.isScreenshot)
SendChat(&quot;/time&quot;)
Sleep 250
SendInput {%Screenshot%}
return
</code></pre></div><p>Заранее спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (mtc_err)]]></author>
			<pubDate>Sat, 03 Mar 2018 09:01:02 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123887#p123887</guid>
		</item>
	</channel>
</rss>
