<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9475&amp;type=atom" />
	<updated>2015-08-28T19:47:13Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9475</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96869#p96869" />
			<content type="html"><![CDATA[<p>А так не видно разве? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-08-28T19:47:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96869#p96869</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96868#p96868" />
			<content type="html"><![CDATA[<p>Ну да не нужны просто для себя пометил где x, а где y. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-08-28T19:46:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96868#p96868</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96867#p96867" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yalanne пишет:</cite><blockquote><div class="codebox"><pre><code>return ((xm &gt;= x1) and (xm &lt;= x2)) and ((ym &gt;= y1) and (ym &lt;= y2))</code></pre></div></blockquote></div><p>Здесь скобки не нужны.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-08-28T19:45:03Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96867#p96867</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96866#p96866" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>vkvolk пишет:</cite><blockquote><p>Возможно ли отменять нажатие левой кнопки мыши в определенной области экрана? Или переназначить на нажатие, например правой кнопки мыши.</p></blockquote></div><div class="codebox"><pre><code>CoordMode, Mouse, Screen
IfPos(x1,y1,x2,y2){
MouseGetPos xm,ym
return ((xm &gt;= x1) and (xm &lt;= x2)) and ((ym &gt;= y1) and (ym &lt;= y2))
}

#IF IfPos(0,0,200,200)
LButton::return

#IF IfPos(A_ScreenWidth-200,0    ,A_ScreenWidth,200)
LButton::RButton

#if
</code></pre></div><p>В левом верхнем углу отменяет левую кнопку мыши, в правом углу заменяет на правую.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-08-28T19:42:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96866#p96866</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96859#p96859" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=10879">AHK: Отменить нажатие ЛКМ</a></p><p>Возможно ли отменять нажатие левой кнопки мыши в определенной области экрана? Или переназначить на нажатие, например правой кнопки мыши.</p>]]></content>
			<author>
				<name><![CDATA[vkvolk]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32817</uri>
			</author>
			<updated>2015-08-28T18:33:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96859#p96859</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=90593#p90593" />
			<content type="html"><![CDATA[<p>Вот так:<br /></p><div class="codebox"><pre><code>; блокировка ЛКМ в определённом участке экрана:
   
LButton::
MouseGetPos, x, y
IF ((x&lt;0) OR (x&gt;300)) OR ((y&lt;0) OR (y&gt;333))
Send, {LButton down}
Return

LButton Up:: Send, {LButton up} ; обязательно, иначе мышь не отжимается</code></pre></div><p>работает.<br />А как сделать по условию </p><div class="codebox"><pre><code>IfWinActive, [</code></pre></div><p>?<br />Вот так:</p><div class="codebox"><pre><code>  IfWinActive, [
{
   LButton::
MouseGetPos, x, y
IF ((x&lt;0) OR (x&gt;300)) OR ((y&lt;0) OR (y&gt;333))
Send, {LButton down}
Return

LButton Up:: Send, {LButton up} ; обязательно, иначе мышь не отжимается
}
Return</code></pre></div><p>ругается.</p>]]></content>
			<author>
				<name><![CDATA[ascerdfg1]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24672</uri>
			</author>
			<updated>2015-01-16T06:37:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=90593#p90593</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=90592#p90592" />
			<content type="html"><![CDATA[<p>Ругается на needcoord()</p>]]></content>
			<author>
				<name><![CDATA[ascerdfg1]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24672</uri>
			</author>
			<updated>2015-01-16T05:33:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=90592#p90592</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81868#p81868" />
			<content type="html"><![CDATA[<p>Спасибо за ответы, как появится время, буду разбираться.</p>]]></content>
			<author>
				<name><![CDATA[D.Man]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32076</uri>
			</author>
			<updated>2014-04-17T06:32:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81868#p81868</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81853#p81853" />
			<content type="html"><![CDATA[<p>Тогда запускаемая клавиша не будет LButton или я не так уловил вашу мысль?</p>]]></content>
			<author>
				<name><![CDATA[Странникх]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30605</uri>
			</author>
			<updated>2014-04-16T18:11:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81853#p81853</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81852#p81852" />
			<content type="html"><![CDATA[<p>Условие в #if должно быть быстрым, оно выполняется во время callback хука, нет ничего хуже чем зависшая callback процедура.</p><p>Если SendInput {F1}{F1} нужно посылать при каждом клике - просто измени Lbutton::</p>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-16T18:06:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81852#p81852</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81849#p81849" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Global x1 := 0, y1 := 0, x2 := 300, y2 := 300

#IF needcoord()
LButton::Return
#IF

needcoord() {
    MouseGetPos, x, y
    if !(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2)
        Return 1 
}</code></pre></div><p>Сюда можно вставить SendInput {F1}{F1} , а затем Return 1 (или блок нажатия ЛКМ)?</p>]]></content>
			<author>
				<name><![CDATA[Странникх]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30605</uri>
			</author>
			<updated>2014-04-16T16:57:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81849#p81849</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81815#p81815" />
			<content type="html"><![CDATA[<p>Теоретически, примерно так:<br /></p><div class="codebox"><pre><code>
Global x1 := 0, y1 := 0, x2 := 300, y2 := 300, time := A_TickCount - 3100

#IF block()
LButton::Return
#IF

block() { 
    if (A_TickCount-time &lt; 3000)
        Return 1
    MouseGetPos, x, y
    PixelGetColor FM, 555, 666 
    PixelGetColor BM, 777, 888
    if (!(x &lt; x1 || x &gt; x2 || y &lt; y1 || y &gt; y2) &amp;&amp; (BM = 0x3A2521 &amp;&amp; FM = 0xFFFFFF) &amp;&amp; (time := A_TickCount))
        Return 1 
}
</code></pre></div><p>сам не проверял.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-15T12:36:39Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81815#p81815</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81814#p81814" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Функция проверки координат.</p></blockquote></div><p>понятно, спс</p>]]></content>
			<author>
				<name><![CDATA[D.Man]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32076</uri>
			</author>
			<updated>2014-04-15T12:20:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81814#p81814</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81812#p81812" />
			<content type="html"><![CDATA[<p>С тем как блокировать клики мыши разобрался. Есть еще вопрос. По-началу думал, что сам с этим разберусь, однако, что-то ничего не выходит.</p><p>Суть такова. Нужно, по определенным условиям, блокировать на несколько секунд возможность кликов мышью в определенном диапазоне координат.</p><p>Условия: в 2-х точка окна цвета пикселов приобретают определенные значения. Код, условно:</p><div class="codebox"><pre><code>

Begin:

Loop

PixelGetColor FM, 555, 666 
PixelGetColor BM, 777, 888

if ( FM = ... ) AND (BM = ... )
       goto BlockMouse 

... ; код (горячие клавиши, в основном)

return


BlockMouse :   ; подпрограмма блочащая клики

...

Goto Begin
</code></pre></div><p>Насколько адекватен примерный фрагмент кода?</p><p>И как можно задать время блокирования кликов?</p>]]></content>
			<author>
				<name><![CDATA[D.Man]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32076</uri>
			</author>
			<updated>2014-04-15T12:17:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81812#p81812</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клики мышью в определенных координатах окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=81810#p81810" />
			<content type="html"><![CDATA[<p>Функция проверки координат.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-15T11:55:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=81810#p81810</id>
		</entry>
</feed>
