Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnKeydown

Status
Not open for further replies.

Zyrenthian

Programmer
Mar 30, 2001
1,440
US
Hi All,
Got a question, I have a list control and I want to override the up and down arrows. Captureing the keydown event it easy but what I need to know is if the user has the shift key down while pressing the up or down arrow. How can I test for that as well?

Code:
LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
// TODO: Add your control notification handler code here

   switch(pLVKeyDow->wVKey)
   {
   case VK_DOWN:
   {
     TRACE("DOWN\n");
     // stuff
   }
   case VK_UP:
   {
     TRACE("UP\n");
     // stuff
   }
   }// end switch

So the "stuff" works fine except for the fact that it behaves like the shift is down when it is not. If I modify it to not behave like the shift is down then I get the opposite result when shift is down. How can I check for 2 keys being down?

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top