<?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: Right mouse button doesn't work after i've added middle mouse button listener. in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1023052#M2305</link>
    <description>&lt;P&gt;You can fix this easily.&amp;nbsp; What has happened is that you've created your own interaction listener and taken over the onMousePressed event with your own logic.&amp;nbsp; What you need to do is pass the event back to the base class onMousePressed event if you are not pressing the middle mouse button.&amp;nbsp; See the "super" addition I've made to your code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;          if(e.getButton() == MouseButton.MIDDLE)
          {
            javafx.geometry.Point2D screenPoint = new javafx.geometry.Point2D(Math.round(e.getX()), Math.round(e.getY()));
            com.esri.arcgisruntime.geometry.Point surfacePoint = sceneView.screenToBaseSurface(screenPoint);
            //JOptionPane.showMessageDialog(null, "Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());
            System.out.println("Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());
            // consume the event as you don't want any more to happen.
            e.consume();
          } else {
            // let the default listener you've overridden deal with other events
            super.onMousePressed(e);
          }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 17:07:16 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2021-02-03T17:07:16Z</dc:date>
    <item>
      <title>Right mouse button doesn't work after i've added middle mouse button listener.</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1022499#M2304</link>
      <description>&lt;P&gt;Right mouse button doesn't work on the Scene after i've added mouse listener for middle mouse button and i cant rotate the scene using right mouse button now. Left click still works and i can move on the scene.&lt;/P&gt;&lt;P&gt;sceneView.setInteractionListener(new DefaultInteractionListener(sceneView)&lt;BR /&gt;{&lt;BR /&gt;public void onMousePressed(javafx.scene.input.MouseEvent e)&lt;BR /&gt;{&lt;BR /&gt;if(e.getButton() == MouseButton.MIDDLE)&lt;BR /&gt;{&lt;BR /&gt;javafx.geometry.Point2D screenPoint = new javafx.geometry.Point2D(Math.round(e.getX()), Math.round(e.getY()));&lt;BR /&gt;com.esri.arcgisruntime.geometry.Point surfacePoint = sceneView.screenToBaseSurface(screenPoint);&lt;BR /&gt;JOptionPane.showMessageDialog(null, "Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Feb 2021 06:28:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1022499#M2304</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2021-02-03T06:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Right mouse button doesn't work after i've added middle mouse button listener.</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1023052#M2305</link>
      <description>&lt;P&gt;You can fix this easily.&amp;nbsp; What has happened is that you've created your own interaction listener and taken over the onMousePressed event with your own logic.&amp;nbsp; What you need to do is pass the event back to the base class onMousePressed event if you are not pressing the middle mouse button.&amp;nbsp; See the "super" addition I've made to your code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;          if(e.getButton() == MouseButton.MIDDLE)
          {
            javafx.geometry.Point2D screenPoint = new javafx.geometry.Point2D(Math.round(e.getX()), Math.round(e.getY()));
            com.esri.arcgisruntime.geometry.Point surfacePoint = sceneView.screenToBaseSurface(screenPoint);
            //JOptionPane.showMessageDialog(null, "Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());
            System.out.println("Elevation: "+surfacePoint.getZ()+" Longitude: "+surfacePoint.getX()+" Latitude: "+surfacePoint.getY());
            // consume the event as you don't want any more to happen.
            e.consume();
          } else {
            // let the default listener you've overridden deal with other events
            super.onMousePressed(e);
          }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 17:07:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1023052#M2305</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-02-03T17:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Right mouse button doesn't work after i've added middle mouse button listener.</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1024307#M2306</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 11:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/right-mouse-button-doesn-t-work-after-i-ve-added/m-p/1024307#M2306</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2021-02-08T11:58:56Z</dc:date>
    </item>
  </channel>
</rss>

