ThinkGeo.com    |     Documentation    |     Premium Support

Trapping Keyboard CTRL, ALT and SHIFT Keys

Hi,


I want to use the same paradigm as ThinkGeo by which the user can press SHIFT+RightClick to create  a rectangle to which the map will then zoom to. Only, in my case, I want the user to CTRL+RightClick to mark an area, and thereby select the features in that rectangle.


Are there any exmaples out there or can somebody assist me with this challenge?


Thanks,


Chris



Chris, 
  
 I’m afraid we cannot do it with the current version. One big reason is that for now we cannot forbid the default panning, that means you cannot track a shape while not moving it unless the “Shift” key is pressed.  
  
 We will definitely enhance this (allow the user to forbid the default mouse operations) in the coming release. If you can disable the default panning, you are able to customize your operations easily. 
  
 Thanks, 
  
 Ben 


How do get the mouse button right click .. In  MapClickedEventArgs there is no way to get whether the click is from mouse right button or left button. Now I need one functionality from client that we need to show a popup with clicked position and save the necessary data by doing right click. 


 


Pl guide me. This is very urgent.


Advance thanks.


Raja.



Hi, Raja 
  
 First off I want to confirm with you about your requirements. You want to show a popup on map and it’s content that shows the clicked information, also you want to have a right click event on the point where the popup locates. And I don’t know what data you want to store or how to store.  If that’s right, please refer to the “MarkerWithContextMenu” and “AddAPopup” samples in our installed samples which you could find their source code at “Markers\MarkerWithContextMenu.aspx” and “GettingStarted\AddAPopup.aspx” respectively. 
  
 Thanks, 
 Khalil



Hi Khalil,


Thanks for your reply. I want to do a right click on map (not on marker) and it should open a popup to create marker. The right click should get the current clicked position like (e.Position). On the popup I want to give the property of the marker..like type of marker, latitude,longitude, marker name, color ..etc. 


In the "MarkerWithContextMenu" .. I can do right click on the created marker alone.. not on the map. So this one may not help me.  Please give some idea to trap right click & its clicked position.


Thanks. Raja



Hi, Raja 
  
 You also could add a Context Menu object on map which has a ContextMenu property. The "AddAContextMenu" sample maybe is just what you want. 
 Now you just need to register a click event on the ContextMenuItem and add marker or do other things in the event handler. 
  
 Thanks, 
 Khalil