<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Соединение клавиши скрипта с Hotkey в gui]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12953&amp;type=atom" />
	<updated>2017-08-28T10:31:18Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12953</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Соединение клавиши скрипта с Hotkey в gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118836#p118836" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>PathIni = IniFile.ini
IniRead, MyGuiHotkey, % PathIni, Section, MyGuiHotkey, % A_Space
Hotkey, % PrSetSuspend := MyGuiHotkey, Suspend, UseErrorLevel

FileInstall, RJeh8poXO98.jpg, C:\Users\User\Desktop\RJeh8poXO98.jpg
Gui, Add, Picture, x-88 y-40 w600 h490 , C:\Users\User\Desktop\RJeh8poXO98.jpg
Gui, Font, S16 Cblue, Verdana
Gui, Add, Text, x142 y10 w190 h30 BackgroundTrans, Введите клавишу
Gui, Add, Hotkey, x62 y40 w300 h30 gSetSuspend vMyGuiHotkey, %MyGuiHotkey%
; Generated using SmartGUI Creator for SciTE
Gui, Show, w479 h379, Зажим
Return

SetSuspend:
	Hotkey, % PrSetSuspend, Off, UseErrorLevel
	GuiControlGet, Hotkey, %A_Gui%:, %A_GuiControl% 
	Hotkey := FormatHotkey(Hotkey)  
	Hotkey, % PrSetSuspend := Hotkey, Suspend 
	IniWrite, % Hotkey, % PathIni, Section, % A_GuiControl
	Return

Suspend:
	Suspend
	Return

LButton::
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      SendInput, {Click}
      Sleep, 0
   }
   Return

FormatHotkey(Hotkey) {   ; http://forum.script-coding.com/viewtopic.php?pid=102089#p102089
	RegExMatch(Hotkey, &quot;S)^([\^\+!]*)(.*?)$&quot;, K)
	If (StrLen(K2) = 1)
		Return K1 . Format(&quot;sc{:X}&quot;, GetKeySC(K2))
	Return Hotkey
} </code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-28T10:31:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118836#p118836</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Соединение клавиши скрипта с Hotkey в gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118834#p118834" />
			<content type="html"><![CDATA[<p>Я прошу мне помочь.<br />Текст скрипта:<br /></p><div class="codebox"><pre><code>LButton::
   While GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
   {
      SendInput, {Click}
      Sleep, 0
   }
   Return
1::Suspend</code></pre></div><p>Текст GUI:<br /></p><div class="codebox"><pre><code>FileInstall, RJeh8poXO98.jpg, C:\Users\User\Desktop\RJeh8poXO98.jpg
Gui, Add, Picture, x-88 y-40 w600 h490 , C:\Users\User\Desktop\RJeh8poXO98.jpg
Gui, Font, S16 Cblue, Verdana
Gui, Add, Text, x142 y10 w190 h30 BackgroundTrans, Введите клавишу
Gui, Add, Hotkey, x62 y40 w300 h30 ,
Gui, Add, Button, x162 y80 w120 h30, ОК
; Generated using SmartGUI Creator for SciTE
Gui, Show, w479 h379, Зажим
return
GuiClose:
ExitApp</code></pre></div><p>Я хочу сделать так что бы при запуске срипта и при смене HotKey изменял и цифра включающая Suspend и отключающая его же. Изначально стоит 1. Очень прошу помочь.</p>]]></content>
			<author>
				<name><![CDATA[aktor311]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38738</uri>
			</author>
			<updated>2017-08-28T09:58:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118834#p118834</id>
		</entry>
</feed>
