<?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=13728&amp;type=atom" />
	<updated>2018-05-22T19:10:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13728</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запись в переменную каждого нажатия.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125550#p125550" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong><br />Спасибо огромное. А разница всего в одном знаке xD. Дай Бог тебе здоровья</p>]]></content>
			<author>
				<name><![CDATA[misha.ivoilov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39279</uri>
			</author>
			<updated>2018-05-22T19:10:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125550#p125550</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запись в переменную каждого нажатия.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125541#p125541" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>SetBatchLines -1
cop := &quot;0|1|2|3|4|5|6|7|8|9&quot;    
Loop, Parse, cop, |  
    Hotkey, ~%A_LoopField%, cop, UseErrorLevel
return
 
cop: 
    ThisHotkey .= SubStr(A_ThisHotkey, 2)
    MsgBox % &quot;вы нажали: &quot;  ThisHotkey
    return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-05-22T15:18:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125541#p125541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Запись в переменную каждого нажатия.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125538#p125538" />
			<content type="html"><![CDATA[<h5>Доброго времени суток</h5><p>Нужен скрипт, который выполняет следующую функцию, записывает все нажатые клавиши в переменную.<br />Например, прописываю 1 - сохраняет в переменной 1. Следом тыкаю 2 - в переменной уже 12. Ну и так далее.<br />Пытался что-то сделать из этого<br /></p><div class="codebox"><pre><code>
SetBatchLines -1
cop := &quot;0|1|2|3|4|5|6|7|8|9&quot;    
Loop, Parse, cop, |  
    Hotkey, ~%A_LoopField%, cop, UseErrorLevel
return
 
cop: 
    ThisHotkey := SubStr(A_ThisHotkey, 2)
    MsgBox % &quot;вы нажали: &quot;  ThisHotkey
    return
</code></pre></div><p>.. но ничего не получилось. Также пробовал через Input and ErrorLevel = Endkey:<br /></p><div class="codebox"><pre><code>
F2::
Loop,
{
Input, a, L1 V, {1}{2}{3}{4}{5}{6}{7}{8}{9}{0}
if (ErrorLevel = &quot;EndKey:1&quot;) or (ErrorLevel = &quot;EndKey:2&quot;) or (ErrorLevel = &quot;EndKey:3&quot;) or (ErrorLevel = &quot;EndKey:4&quot;) or (ErrorLevel = &quot;EndKey:5&quot;) or (ErrorLevel = &quot;EndKey:6&quot;) or (ErrorLevel = &quot;EndKey:7&quot;) or (ErrorLevel = &quot;EndKey:8&quot;) or (ErrorLevel = &quot;EndKey:9&quot;) or (ErrorLevel = &quot;EndKey:0&quot;) 
break
}
if ErrorLevel = EndKey:1
{
a := 1
}
if ErrorLevel = EndKey:2
{
a := 2
}
if ErrorLevel = EndKey:3
{
a := 3
}
if ErrorLevel = EndKey:4
{
a := 4
}
if ErrorLevel = EndKey:5
{
a := 5
}
if ErrorLevel = EndKey:6
{
a := 6
}
if ErrorLevel = EndKey:7
{
a := 7
}
if ErrorLevel = EndKey:8
{
a := 8
}
if ErrorLevel = EndKey:9
{
a := 9
}
if ErrorLevel = EndKey:0
{
a := 0
}
Loop,
{
Input, b, L1 V T1, {1}{2}{3}{4}{5}{6}{7}{8}{9}{0}
if (ErrorLevel = &quot;EndKey:1&quot;) or (ErrorLevel = &quot;EndKey:2&quot;) or (ErrorLevel = &quot;EndKey:3&quot;) or (ErrorLevel = &quot;EndKey:4&quot;) or (ErrorLevel = &quot;EndKey:5&quot;) or (ErrorLevel = &quot;EndKey:6&quot;) or (ErrorLevel = &quot;EndKey:7&quot;) or (ErrorLevel = &quot;EndKey:8&quot;) or (ErrorLevel = &quot;EndKey:9&quot;) or (ErrorLevel = &quot;EndKey:0&quot;) or (ErrorLevel = &quot;Timeout&quot;) 
break
}
if ErrorLevel = EndKey:1
{
b := 1
}
if ErrorLevel = EndKey:2
{
b := 2
}
if ErrorLevel = EndKey:3
{
b := 3
}
if ErrorLevel = EndKey:4
{
b := 4
}
if ErrorLevel = EndKey:5
{
b := 5
}
if ErrorLevel = EndKey:6
{
b := 6
}
if ErrorLevel = EndKey:7
{
b := 7
}
if ErrorLevel = EndKey:8
{
b := 8
}
if ErrorLevel = EndKey:9
{
b := 9
}
if ErrorLevel = EndKey:0
{
b := 0
}
if ErrorLevel = Timeout
{
goto, metka
}
Loop,
{
Input, c, L1 V T1, {1}{2}{3}{4}{5}{6}{7}{8}{9}{0}
if (ErrorLevel = &quot;EndKey:1&quot;) or (ErrorLevel = &quot;EndKey:2&quot;) or (ErrorLevel = &quot;EndKey:3&quot;) or (ErrorLevel = &quot;EndKey:4&quot;) or (ErrorLevel = &quot;EndKey:5&quot;) or (ErrorLevel = &quot;EndKey:6&quot;) or (ErrorLevel = &quot;EndKey:7&quot;) or (ErrorLevel = &quot;EndKey:8&quot;) or (ErrorLevel = &quot;EndKey:9&quot;) or (ErrorLevel = &quot;EndKey:0&quot;) or (ErrorLevel = &quot;Timeout&quot;)
break
}
if ErrorLevel = EndKey:1
{
c := 1
}
if ErrorLevel = EndKey:2
{
c := 2
}
if ErrorLevel = EndKey:3
{
c := 3
}
if ErrorLevel = EndKey:4
{
c := 4
}
if ErrorLevel = EndKey:5
{
c := 5
}
if ErrorLevel = EndKey:6
{
c := 6
}
if ErrorLevel = EndKey:7
{
c := 7
}
if ErrorLevel = EndKey:8
{
c := 8
}
if ErrorLevel = EndKey:9
{
c := 9
}
if ErrorLevel = EndKey:0
{
c := 0
}
if ErrorLevel = Timeout
{
goto, metka
}
metka:
id = %a% %b% %c%
StringReplace, id, id, %A_Space%, , All
</code></pre></div><p>... но если нажать и задержать любую кнопку на мышке или клавиатуре, то последний скрипт приостанавливает свою работу.</p><p>Помогите исправить последний код, либо предложите какой другой вариант. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[misha.ivoilov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39279</uri>
			</author>
			<updated>2018-05-22T13:01:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125538#p125538</id>
		</entry>
</feed>
