<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Считывание клика мыши только в определенных координатах]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=17496</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=17496&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Считывание клика мыши только в определенных координатах».]]></description>
		<lastBuildDate>Thu, 08 Dec 2022 21:36:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=155920#p155920</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 08 Dec 2022 21:36:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=155920#p155920</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=155919#p155919</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (will)]]></author>
			<pubDate>Thu, 08 Dec 2022 20:58:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=155919#p155919</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=155918#p155918</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Спасибо большое. Оно нажимает и считывает действие, но теперь сама кнопка не нажимается в игре&nbsp; даже когда рисовал квадратик он не хотел рисоваться.&nbsp; <br /><a href="https://imgur.com/a/z7Zf2Zh">https://imgur.com/a/z7Zf2Zh</a></p>]]></description>
			<author><![CDATA[null@example.com (will)]]></author>
			<pubDate>Thu, 08 Dec 2022 20:48:37 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=155918#p155918</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=155914#p155914</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 08 Dec 2022 17:51:05 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=155914#p155914</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=155913#p155913</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 08 Dec 2022 17:45:28 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=155913#p155913</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Считывание клика мыши только в определенных координатах]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=155904#p155904</link>
			<description><![CDATA[<p>Всем доброго времени суток. Как сделать чтоб при действие выполнялось после того как вы нажмете ЛКМ в определенной зоне ?</p>]]></description>
			<author><![CDATA[null@example.com (will)]]></author>
			<pubDate>Thu, 08 Dec 2022 00:24:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=155904#p155904</guid>
		</item>
	</channel>
</rss>
