CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jan 2011
    Location
    Richmond, Va
    Posts
    32

    How to use GetKeyState()

    Code:
    WORD keyState;
    //.............
    keyState = GetKeyState(VK_SHIFT);
    		if(HIWORD(keyState) & 0x80)
    		{
    			MessageBox(NULL, TEXT("SHIFT Down"), TEXT("Key State"), MB_OK);
    		}
    Not sure how to go about detecting whether the hi order bit is 1...which is what I need D:

    -edit-
    ok nm I got it

    Code:
    if(GetKeyState(VK_SHIFT) & 0x80)
    		{
    			MessageBox(NULL, TEXT("SHIFT Down"), TEXT("Key State"), MB_OK);
    		}
    Last edited by Amaz1ng; January 18th, 2011 at 09:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured