<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11274&amp;type=atom" />
	<updated>2016-02-02T09:17:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11274</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100776#p100776" />
			<content type="html"><![CDATA[<p>Понял, благодарю за помощь!</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-02-02T09:17:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100776#p100776</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100774#p100774" />
			<content type="html"><![CDATA[<p><strong>OmTatSat</strong> Зависит от задачи: если нужно узнать какая была нажата кнопка последней то ваш вариант с A_priorkey конечно лучше. Мой вариант в отличии от вашего следит только за конкретными хоткеями, и считает их нажатия.</p>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2016-02-02T07:40:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100774#p100774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100757#p100757" />
			<content type="html"><![CDATA[<p><strong>Nikva</strong> спасибо, работает. Такой вариант предпочтительней чем с использованием A_priorkey, требует меньше ресурсов, времени?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-02-01T15:01:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100757#p100757</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100752#p100752" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#NoTrayIcon
#ifwinactive, ahk_class MozillaWindowClass
~MButton::
  MState := 1
  starttime1 := A_TickCount
  MouseGetPos, OutputVarY, OutputVarX
  KeyWait, MButton
  MouseGetPos, OutputVarY2, OutputVarX2
  elapsedtime := A_TickCount - starttime1
  IF ((wheel = &quot;&quot;) &amp; (OutputVarX &gt; 108) &amp; (elapsedtime &gt; 220) &amp; (elapsedtime &lt; 520) &amp; (OutputVarX = OutputVarX2) &amp; (OutputVarY = OutputVarY2) &amp; (A_Cursor = &quot;Arrow&quot;))
  {
  ToolTip, %A_priorkey%
  Send, +{mButton}
  }
  wheel := &quot;&quot;
Return

#If MState
~MButton up::MState := 0

~WheelUp::
~WheelDown::
  wheel ++
return
#If</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2016-02-01T10:19:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100752#p100752</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100751#p100751" />
			<content type="html"><![CDATA[<p><strong>Nikva</strong> наоборот, если было прокручено колесо то не выполнять</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-02-01T10:06:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100751#p100751</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100750#p100750" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>OmTatSat пишет:</cite><blockquote><p>в тултипе цифры появляются, так должно быть?</p></blockquote></div><p>Для наглядности, он считает количество поворотов колеса пока оно зажато.</p><p>Правильно ли я понял задачу?<br />Проверить, пока было зажато колесо мыши, крутилось ли оно, и если соблюдены условия выполнить действие?<br /></p><div class="codebox"><pre><code>#NoTrayIcon
#ifwinactive, ahk_class MozillaWindowClass
~MButton::
MState := 1
starttime1 := A_TickCount
MouseGetPos, OutputVarY, OutputVarX
Return

#If MState
~MButton up::
  MState := 0
  ToolTip
Return

~WheelUp::
~WheelDown::
  MouseGetPos, OutputVarY2, OutputVarX2
  elapsedtime := A_TickCount - starttime1
IF ((OutputVarX &gt; 108) &amp; (elapsedtime &gt; 220) &amp; (elapsedtime &lt; 520) &amp; (OutputVarX = OutputVarX2) &amp; (OutputVarY = OutputVarY2) &amp; (A_Cursor = &quot;Arrow&quot;))
  {
  ToolTip, %A_priorkey%
  Send, +{mButton}
  }
Return

#If</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2016-02-01T09:56:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100750#p100750</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100749#p100749" />
			<content type="html"><![CDATA[<p><strong>Nikva</strong> в тултипе цифры появляются, так должно быть?</p><p>В любом случае это реакция на wheel, спасибо за вариант!</p><p>нашел вариант с IF (A_priorkey = &quot;mbutton&quot;)<br />использую его, так как прост в контексте моего скрипта, если было прокручено колесо то A_priorkey выдаёт wheel...</p><p>приведу весь скрипт, может кто-то знает более правильный подход</p><div class="codebox"><pre><code>#NoTrayIcon
#ifwinactive, ahk_class MozillaWindowClass
~mButton::
starttime1 := A_TickCount
MouseGetPos, OutputVarY, OutputVarX
KeyWait, MButton
MouseGetPos, OutputVarY2, OutputVarX2
elapsedtime := A_TickCount - starttime1


IF ((A_priorkey = &quot;mbutton&quot;) &amp; (OutputVarX &gt; 108) &amp; (elapsedtime &gt; 220) &amp; (elapsedtime &lt; 520) &amp; (OutputVarX = OutputVarX2) &amp; (OutputVary = OutputVary2) &amp; (A_Cursor = &quot;Arrow&quot;))
{
	ToolTip, %A_priorkey%
Send, +{mButton}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-02-01T09:32:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100749#p100749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100748#p100748" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>~MButton::MState := 1

#If MState
~MButton up::
  MState := 0
  OutputVar := &quot;&quot;
  ToolTip
Return

~WheelUp::
~WheelDown::
  OutputVar ++
  ToolTip, %OutputVar%
Return

#If</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2016-02-01T09:15:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100748#p100748</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Узнать была ли нажата клавиша, пока был зажат hotkey.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100746#p100746" />
			<content type="html"><![CDATA[<p>Здравствуйте, нужно по нажатию mbutton проверить крутился ли wheel пока она была нажата</p><div class="codebox"><pre><code>~mButton::

keywait, MButton

Getkeystate, OutputVar, WheelUp, p

ToolTip, %OutputVar%
OutputVar = 
return</code></pre></div><p>проблема в том, что OutputVar отдает U до первого прокрута колеса, потом всегда выдает D, как сделать, чтобы была реальная проверка, заместо старых данных?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-02-01T08:01:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100746#p100746</id>
		</entry>
</feed>
