<?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: SketchViewModel and ctrl in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-and-ctrl/m-p/1649981#M87617</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/125243"&gt;@PhilBastian&lt;/a&gt;&amp;nbsp;I am almost 5 years late to the party, but I had the same problem recently. After doing some obfuscated JS archaeology, I came up with following solution:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// import sketchKeys variable from keybindings
import { sketchKeys } from '@arcgis/core/views/interactive/keybindings';

// assign some arbitrary string to constraint
sheetKeys.constraint = '__NOT_A_KEY__'

// now you can create, without preserving aspect ratio while holding Shift
sketch.create('rectangle');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the original behavior back, you will have to reset &lt;STRONG&gt;sheetKeys.constraint:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// reset preserv aspect ratio behavior
sheetKeys.constraint = 'Shift';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But be aware: This solution may break at any time, because&amp;nbsp;it relies&amp;nbsp; an internal undocumented API.&lt;BR /&gt;&lt;BR /&gt;(Tested with 4.33.x)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Sep 2025 08:05:57 GMT</pubDate>
    <dc:creator>SebastianFrey1</dc:creator>
    <dc:date>2025-09-12T08:05:57Z</dc:date>
    <item>
      <title>SketchViewModel and ctrl</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-and-ctrl/m-p/1005429#M70937</link>
      <description>&lt;P&gt;I have a requirement to draw a rectangle for selecting features. I am doing this using a sketchviewmodel and its create method. A secondary requirement is to change the selection behaviour when the ctrl key is pressed, however the sketchviewmodel has inbuilt functionality to lock the aspect ratio when ctrl is pressed, drawing a square instead of a rectangle. Is there a way to disable this functionality?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 05:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-and-ctrl/m-p/1005429#M70937</guid>
      <dc:creator>PhilBastian</dc:creator>
      <dc:date>2020-11-30T05:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: SketchViewModel and ctrl</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-and-ctrl/m-p/1649981#M87617</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/125243"&gt;@PhilBastian&lt;/a&gt;&amp;nbsp;I am almost 5 years late to the party, but I had the same problem recently. After doing some obfuscated JS archaeology, I came up with following solution:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// import sketchKeys variable from keybindings
import { sketchKeys } from '@arcgis/core/views/interactive/keybindings';

// assign some arbitrary string to constraint
sheetKeys.constraint = '__NOT_A_KEY__'

// now you can create, without preserving aspect ratio while holding Shift
sketch.create('rectangle');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the original behavior back, you will have to reset &lt;STRONG&gt;sheetKeys.constraint:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// reset preserv aspect ratio behavior
sheetKeys.constraint = 'Shift';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But be aware: This solution may break at any time, because&amp;nbsp;it relies&amp;nbsp; an internal undocumented API.&lt;BR /&gt;&lt;BR /&gt;(Tested with 4.33.x)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2025 08:05:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-and-ctrl/m-p/1649981#M87617</guid>
      <dc:creator>SebastianFrey1</dc:creator>
      <dc:date>2025-09-12T08:05:57Z</dc:date>
    </item>
  </channel>
</rss>

