<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get cursor position outside of a Map Tool in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596679#M12761</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/200364"&gt;@BarbaraSchneider2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;could you elaborate some more on what you're trying to achieve and what context you would be in?&lt;/P&gt;</description>
    <pubDate>Tue, 18 Mar 2025 17:26:45 GMT</pubDate>
    <dc:creator>SelimDissem</dc:creator>
    <dc:date>2025-03-18T17:26:45Z</dc:date>
    <item>
      <title>How to get cursor position outside of a Map Tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596501#M12759</link>
      <description>&lt;P&gt;I can get the current cursor position inside a Map Tool as follows:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected override async Task HandleMouseDownAsync(MapViewMouseButtonEventArgs e)
{
	// Get cursor point
	MapPoint mapPoint =  await QueuedTask.Run(() =&amp;gt;
	{
		return ActiveMapView.ClientToMap(e.ClientPoint);
	});
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However, I would like to get the cursor position &lt;STRONG&gt;outside&lt;/STRONG&gt; of a MapTool. Does anyone know how to handle this? I've already posted another question: &lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-catch-event-when-z-changes/m-p/1339114#M10565" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-catch-event-when-z-changes/m-p/1339114#M10565&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Barbara&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 12:01:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596501#M12759</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2025-03-18T12:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cursor position outside of a Map Tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596679#M12761</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/200364"&gt;@BarbaraSchneider2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;could you elaborate some more on what you're trying to achieve and what context you would be in?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 17:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596679#M12761</guid>
      <dc:creator>SelimDissem</dc:creator>
      <dc:date>2025-03-18T17:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cursor position outside of a Map Tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596949#M12767</link>
      <description>&lt;P&gt;Hi Selim,&lt;/P&gt;&lt;P&gt;I want to do the following:&lt;/P&gt;&lt;P&gt;1. The user clicks on a keyboard shortcut&lt;/P&gt;&lt;P&gt;2. This keyboard shortcut is linked to a command, in which I programmatically get the current cursor position and create a MapPoint&lt;/P&gt;&lt;P&gt;Within a map tool, this looks as follows:&lt;/P&gt;&lt;P&gt;1. The user clicks on a keyboard shortcut&lt;/P&gt;&lt;P&gt;2. This keyboard shortcut is linked to a command, in which I programmatically activate a MapTool&lt;/P&gt;&lt;P&gt;3. The user has to click again on the Stereo Map to get the cursor position&lt;/P&gt;&lt;P&gt;--&amp;gt; This is one click more. The users of my applications perform these steps about 500 times a day, so these are 500 clicks more...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 09:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1596949#M12767</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2025-03-19T09:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cursor position outside of a Map Tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1597251#M12772</link>
      <description>&lt;P&gt;Hi Barbara,&lt;/P&gt;&lt;P&gt;As illustrated by your current implementation, the ArcGIS Pro SDK provides you with the MapTool to give you access to the necessary context / information to create a MapPoint based on the position of the mouse within the MapView.&lt;/P&gt;&lt;P&gt;Beyond the scope of the Pro API, you could use the Windows API but will have to manage all the scenarios and conversions yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 19:15:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1597251#M12772</guid>
      <dc:creator>SelimDissem</dc:creator>
      <dc:date>2025-03-19T19:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cursor position outside of a Map Tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1597406#M12775</link>
      <description>&lt;P&gt;I found a solution to the problem:&lt;/P&gt;&lt;P&gt;I declare an internal class member variable (CursorPoint) inside my MapTool which I can access from outside:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class ToolAddRasterPoint : MapTool
{
    internal MapPoint CursorPoint{ get; set; }

    public ToolAddRasterPoint()
    {
        IsSketchTool = true;
        UseSnapping = false;
        SketchType = SketchGeometryType.Point;

        MyModule.ToolAddRasterPoint = this; // to access from outside
    }
        
    protected override async void OnToolMouseMove(MapViewMouseEventArgs e)
    {
        await QueuedTask.Run(() =&amp;gt;
        {
            CursorPoint = MapView.Active.ClientToMap(e.ClientPoint);
        });
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 09:58:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1597406#M12775</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2025-03-20T09:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cursor position outside of a Map Tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1598436#M12787</link>
      <description>&lt;P&gt;This is the code to get the cursor position (x, y, and z) using the Windows API:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;System.Drawing.Point cursorPoint = System.Windows.Forms.Cursor.Position;
System.Windows.Point screenPoint = new System.Windows.Point(cursorPoint.X, cursorPoint.Y);

var mapPoint = await QueuedTask.Run(() =&amp;gt;
{
	// Convert to map position
	return MapView.Active.ScreenToMap(screenPoint);
});&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Mar 2025 09:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-cursor-position-outside-of-a-map-tool/m-p/1598436#M12787</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2025-03-24T09:42:42Z</dc:date>
    </item>
  </channel>
</rss>

