MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




BeforeClick (or MouseClick) determine if a specific key is pressed?

This is a discussion on BeforeClick (or MouseClick) determine if a specific key is pressed? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hey everyone. I'm using Mappoint 2006 and Visual Basic 2005. What I'm trying to determine is if there is a ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-27-2008
OOT OOT is offline
Junior Member
Yellow Belt
 
Join Date: Dec 2006
Posts: 14
BeforeClick (or MouseClick) determine if a specific key is pressed?

Hey everyone. I'm using Mappoint 2006 and Visual Basic 2005. What I'm trying to determine is if there is a way, when a user clicks a pushpin, if a certain key is already depressed (pressed, selected?). Mappoint doesn't have (as far as I can tell) a KeyPress event. I'm not exactly sure if this is possible and definitely not sure how to do it if it is so I'm hoping somebody here can lend a helping hand ... please please please.

So, let's say if a user clicks on a Pushpin, the first thing I want to know is if the Ctrl key is currently depressed? If yes, then do something. If not, do what Mappoint normally does.

Is this possible?

Thank you in advance for any and all help that you can give. It is very much appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-27-2008
Junior Member
Yellow Belt
 
Join Date: Nov 2007
Posts: 12
Re: BeforeClick (or MouseClick) determine if a specific key is pressed?

You could use this API function to examine the key state:

SHORT GetKeyState(int nVirtKey) // virtual-key code;

Where nVirtKey is VK_SHIFT (Shift Key), VK_CONTROL (Ctrl Key), and VK_MENU (Alt Key)

If the function succeeds, the return value specifies the status of the given virtual key. If the high-order bit is 1, the key is down; otherwise, it is up. If the low-order bit is 1, the key is toggled.

The key status returned from this function changes as a given thread reads key messages from its message queue. The status does not reflect the interrupt-level state associated with the hardware. Use the GetAsyncKeyState function (same syntax) to retrieve that information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-31-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: BeforeClick (or MouseClick) determine if a specific key is pressed?

Hi,

there is a shift property in the event handler's argument. You can set there a bitmask to check if shift, alt, or ctrl (or combination) is pressed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/beforeclick-mouseclick-determine-if-specific-key-pressed-7377.html

Posted By For Type Date
Untitled document This thread Refback 07-21-2008 07:12 PM
BeforeClick (or MouseClick) determine if a specific key is pressed? - MapPoint Forums This thread Refback 04-03-2008 07:13 PM
Making Pushpin Locations Immoveable - MapPoint Articles - MP2K Magazine This thread Refback 04-01-2008 11:47 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
BeforeClick event cancel not working with VC++ mayfly MapPoint 2006/2009 Discussion 3 05-05-2007 11:13 AM
beforeclick event mmartin MapPoint 2006/2009 Discussion 2 04-13-2007 06:36 AM
Determine if Map has been closed BirdIslander MapPoint 2006/2009 Discussion 1 12-07-2005 01:33 PM
Determine if a polyline is closed? Anonymous MapPoint 2006/2009 Discussion 4 03-29-2005 11:37 AM
Is there a way to determine the minimum distance b.... Anonymous MapPoint 2006/2009 Discussion 1 01-22-2002 04:45 AM


All times are GMT -5. The time now is 09:27 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Cheap Flights Turkey
Cheap flights to Turkey are a reality when you book online with Holiday Hypermarket. Discover Turkish delights with Turkish cheap flights.

Travel Specialist
Travel Counsellors is a leading travel specialist. We are a Queen's Award winning travel agency.

Holiday in Portugal
A holiday in Portugal is low cost but great value when you book with us online. Transportation and accommodation are excellent and very reasonable too.

Holidays to Antigua
The Holiday Place has fantastic deals on holidays to Antigua. Visit our website to view special offers on holidays to the Caribbean.

Holiday
Searching for the perfect holiday? Well check out ULookUBook online to find out all about your destination and also to book a great value holiday.

Compare holiday prices
Compare holiday prices online where you can see all the possibilities at Travel.co.uk

Cheap Holidays in Lanzarote
Now's the time to get up and go visit the Canary Islands! View cheap holidays in Lanzarote only at On The Beach.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51