<?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=13626&amp;type=atom" />
	<updated>2018-04-16T13:32:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13626</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124763#p124763" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Всё работает. Огромное вам спасибо :-)</p>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-16T13:32:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124763#p124763</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124749#p124749" />
			<content type="html"><![CDATA[<p>А, понял, в чём проблема. В функцию нужно передать имя окна, т. к. внутри функции переменная gui_name не видна:<br /></p><div class="codebox"><pre><code>values := [ {input: &quot;gg ss&quot;, function: Func(&quot;FirstFunc&quot; ), delay: 3000}
          , {input: &quot;gg s&quot; , function: Func(&quot;SecondFunc&quot;), delay: 3000}
          , {input: &quot;ss g&quot; , function: Func(&quot;ThirdFunc&quot; ), delay: 3000} ] 

gui_name := &quot;Main&quot;
Gui, %gui_name%:Add, Edit, vEdit gWatchEdit w150, Текст
Gui, %gui_name%:Show
Return

WatchEdit()  {
   global values
   GuiControlGet, Edit
   for k, v in values
      if RegExMatch(Edit, &quot;^\Q&quot; . v.input . &quot;\E$&quot;) &amp;&amp; i := k
         break
      
   if i  {
      obj := values[i]
      if !obj.delay
         obj.function.Call(A_Gui)
      else  {
         timer := obj.function.Bind(A_Gui)  ; передаём имя окна, оно здесь в переменной A_Gui
         SetTimer, % timer, % &quot;-&quot; . obj.delay
      }
   }
}

FirstFunc(GuiName)  {
   ExitApp
}

SecondFunc(GuiName)  {
   MsgBox, &quot;gg s&quot;
   GuiControl, %GuiName%:, Edit
}

ThirdFunc(GuiName)  {
   MsgBox, &quot;ss g&quot;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-16T09:57:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124749#p124749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124747#p124747" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Похоже я не так объяснил, т.е запутав, из-за чего вы меня немного не так поняли.<br />Оно стирает, стирает ТЕКСТ при запуске скрипта, но нужно, чтобы стирало и текст что мы ввели, те gg s - выскочил msgbox - стёрлась строка и.т.д.<br /></p><div class="codebox"><pre><code>show := 1 

values := [ {input: &quot;gg ss&quot;, function: Func(&quot;FirstFunc&quot; ), delay: 300}
          , {input: &quot;gg s&quot; , function: Func(&quot;SecondFunc&quot;), delay: 300}
          , {input: &quot;ss g&quot; , function: Func(&quot;ThirdFunc&quot; ), delay: 300} ] 
gui_name := &quot;Main&quot; 
Gui, %gui_name%: +AlwaysOnTop 
Gui, %gui_name%:Add, Edit, vEdit gWatchEdit w150, ТЕКСТ
Gui, %gui_name%:Show
Sleep 1000
GuiControl, %gui_name%:, Edit 
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-16T04:30:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124747#p124747</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124743#p124743" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>gui_name := &quot;Main&quot; 
Gui, %gui_name%: +AlwaysOnTop 
Gui, %gui_name%:Add, Edit, vEdit w150, Текст
Gui, %gui_name%:Show
Sleep 1000
GuiControl, %gui_name%:, Edit </code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-15T21:44:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124743#p124743</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124742#p124742" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Я маленько запутался.<br />Я ранее пробовал - не работало.<br />Сейчас - не работает.<br />И так<br /></p><div class="codebox"><pre><code>GuiControl, %gui_name%:Show, Edit</code></pre></div><p>и вот так<br /></p><div class="codebox"><pre><code>GuiControl, %gui_name%:, Edit</code></pre></div><p>Не вижу очевидного, либо чего-то ещё не хватает?</p>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-15T21:29:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124742#p124742</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124741#p124741" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>GuiControl, %gui_name%:, Edit</code></pre></div><p><a href="https://autohotkey.com/docs/commands/GuiControl.htm#Remarks">Ссылка</a> на пример в хэлпе.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-15T21:03:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124741#p124741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124740#p124740" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Про шерстил с конца до середины <a href="https://autohotkey.com/docs/commands/GuiControl.htm">https://autohotkey.com/docs/commands/GuiControl.htm</a><br />Я себе пару нервных клеток убил, но результата не дало.<br />Напишите прямой ответ! Захочу - не найду.</p>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-15T20:59:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124740#p124740</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124739#p124739" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>MirchikAhtung пишет:</cite><blockquote><div class="codebox"><pre><code>GuiControl,, %gui_name%:Edit</code></pre></div></blockquote></div><p>%gui_name% не в том месте. Читайте хелп внимательнее.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-15T20:08:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124739#p124739</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124738#p124738" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>У меня зачищает.</p><div class="codebox"><pre><code>Gui, Add, Edit, vEdit w150, Текст
Gui, Show
Sleep, 1000
GuiControl,, Edit</code></pre></div></blockquote></div><p>Вот моё начало, я не понимаю что тут всё портит..<br /></p><div class="codebox"><pre><code>show := 1 

values := [ {input: &quot;gg ss&quot;, function: Func(&quot;FirstFunc&quot; ), delay: 300}
          , {input: &quot;gg s&quot; , function: Func(&quot;SecondFunc&quot;), delay: 300}
          , {input: &quot;ss g&quot; , function: Func(&quot;ThirdFunc&quot; ), delay: 300} ] 
gui_name := &quot;Main&quot; 
Gui, %gui_name%: +AlwaysOnTop 
Gui, %gui_name%:Add, Edit, vEdit gWatchEdit w150, Текст
Gui, %gui_name%:Show
GuiControl,, %gui_name%:Edit
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-15T20:04:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124738#p124738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124737#p124737" />
			<content type="html"><![CDATA[<p>У меня зачищает.</p><div class="codebox"><pre><code>Gui, Add, Edit, vEdit w150, Текст
Gui, Show
Sleep, 1000
GuiControl,, Edit</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-15T19:55:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124737#p124737</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124735#p124735" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Ассоциированная переменная не vEdit, а просто Edit. v — это название опции.</p></blockquote></div><div class="codebox"><pre><code>GuiControl,, Edit </code></pre></div><p> <br />Не зачищает строку для ввода.<br />Использую последний код, что ты мне скинул.</p>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-15T19:20:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124735#p124735</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124734#p124734" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>MirchikAhtung пишет:</cite><blockquote><div class="codebox"><pre><code>GuiControl,, vEdit</code></pre></div></blockquote></div><p>Ассоциированная переменная не vEdit, а просто Edit. v — это название опции.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-15T19:00:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124734#p124734</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124733#p124733" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Вдвойне рукалицо.<br />GuiControl, vEdit в функции после msgbox не затирает поле для ввода, мои знания в AHK очень скудны, и помимо этого ничего не лезет в голову..</p><div class="codebox"><pre><code>
SecondFunc()  {
   MsgBox, &quot;gg s&quot;
GuiControl,, vEdit
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-15T18:45:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124733#p124733</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124728#p124728" />
			<content type="html"><![CDATA[<p><strong>MirchikAhtung</strong>, рукалицо.jpeg<br /></p><div class="codebox"><pre><code>values := [ {input: &quot;gg ss&quot;, function: Func(&quot;FirstFunc&quot; ), delay: 3000}
          , {input: &quot;gg s&quot; , function: Func(&quot;SecondFunc&quot;), delay: 3000}
          , {input: &quot;ss g&quot; , function: Func(&quot;ThirdFunc&quot; ), delay: 3000} ] 

Gui, Add, Edit, vEdit gWatchEdit
Gui, Show
Return

WatchEdit()  {
   global values
   GuiControlGet, Edit
   for k, v in values
      if RegExMatch(Edit, &quot;^\Q&quot; . v.input . &quot;\E$&quot;) &amp;&amp; i := k
         break
      
   if i  {
      obj := values[i]
      if !obj.delay
         obj.function.Call()
      else  {
         timer := obj.function
         SetTimer, % timer, % &quot;-&quot; . obj.delay
      }
   }
}

FirstFunc()  {
   ExitApp
}

SecondFunc()  {
   MsgBox, &quot;gg s&quot;
}

ThirdFunc()  {
   MsgBox, &quot;ss g&quot;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-15T14:18:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124728#p124728</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как запретить ввод ПРОБЕЛА в поле для ввода?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124727#p124727" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Это я попробывал поставить таймер на все 3 функции :-(</p>]]></content>
			<author>
				<name><![CDATA[MirchikAhtung]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38635</uri>
			</author>
			<updated>2018-04-15T14:03:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124727#p124727</id>
		</entry>
</feed>
