<?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=17496&amp;type=atom" />
	<updated>2022-12-08T21:36:44Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=17496</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=155920#p155920" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>will пишет:</cite><blockquote><p>но теперь сама кнопка не нажимается в игре</p></blockquote></div><p>Темы по играм должны быть в соответствующей ветке, переношу. Если нужно, чтобы LButton в области сохраняла свою функцию, добавьте тильду к горячей клавише:<br /></p><div class="codebox"><pre><code>~LButton::</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-12-08T21:36:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=155920#p155920</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=155919#p155919" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>will пишет:</cite><blockquote><p><strong>teadrinker</strong><br />Спасибо большое. Оно нажимает и считывает действие, но теперь сама кнопка не нажимается в игре&nbsp; даже когда рисовал квадратик он не хотел рисоваться.&nbsp; <br /><a href="https://imgur.com/a/z7Zf2Zh">https://imgur.com/a/z7Zf2Zh</a></p></blockquote></div><p>В общем: Просто добавил действие клик по координатам MouseGetPos. <br />Спасибо огромное!</p>]]></content>
			<author>
				<name><![CDATA[will]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42886</uri>
			</author>
			<updated>2022-12-08T20:58:06Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=155919#p155919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=155918#p155918" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Спасибо большое. Оно нажимает и считывает действие, но теперь сама кнопка не нажимается в игре&nbsp; даже когда рисовал квадратик он не хотел рисоваться.&nbsp; <br /><a href="https://imgur.com/a/z7Zf2Zh">https://imgur.com/a/z7Zf2Zh</a></p>]]></content>
			<author>
				<name><![CDATA[will]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42886</uri>
			</author>
			<updated>2022-12-08T20:48:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=155918#p155918</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=155914#p155914" />
			<content type="html"><![CDATA[<p>Или так:<br /></p><div class="codebox"><pre><code>area1 := {left: 0, top: 0, right: 300, bottom: 300}
area2 := {left: A_ScreenWidth - 300, top: 0, right: A_ScreenWidth, bottom: 300}

#If area := MouseInArea(area1, area2)
LButton::
   Switch area {
      case 1:
         MsgBox, Действия для зоны №1
      case 2:
         MsgBox, Действия для зоны №2
   }
Return

MouseInArea(areas*) {
   CoordMode, Mouse
   MouseGetPos, x, y
   for k, area in areas {
      if (x &gt;= area.left &amp;&amp; x &lt;= area.right &amp;&amp; y &gt;= area.top &amp;&amp; y &lt;= area.bottom)
         Return k
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-12-08T17:51:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=155914#p155914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=155913#p155913" />
			<content type="html"><![CDATA[<p>Пример:<br /></p><div class="codebox"><pre><code>area1 := {left: 0, top: 0, right: 300, bottom: 300}
area2 := {left: A_ScreenWidth - 300, top: 0, right: A_ScreenWidth, bottom: 300}

#If area := MouseInArea(area1, area2)
LButton::
   if (area = 1) {
      MsgBox, Действия для зоны №1
   }
   if (area = 2) {
      MsgBox, Действия для зоны №2
   }
Return

MouseInArea(areas*) {
   CoordMode, Mouse
   MouseGetPos, x, y
   for k, area in areas {
      if (x &gt;= area.left &amp;&amp; x &lt;= area.right &amp;&amp; y &gt;= area.top &amp;&amp; y &lt;= area.bottom)
         Return k
   }
}</code></pre></div><p>Первая область — квадрат 300х300 в левом верхнем углу экрана, вторая — квадрат 300х300 в правом верхнем углу экрана.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-12-08T17:45:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=155913#p155913</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=155904#p155904" />
			<content type="html"><![CDATA[<p>Всем доброго времени суток. Как сделать чтоб при действие выполнялось после того как вы нажмете ЛКМ в определенной зоне ?</p>]]></content>
			<author>
				<name><![CDATA[will]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42886</uri>
			</author>
			<updated>2022-12-08T00:24:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=155904#p155904</id>
		</entry>
</feed>
