Posted By

jimfred on 12/11/08


Tagged

windows api shift


Versions (?)

Win32 API to check shift state


 / Published in: C++
 

  1. // Header Declared in Winuser.h, include Windows.h
  2. // Import library User32.lib
  3.  
  4.  
  5. // Look for a shift key to be pressed.
  6. // '& 0x8000' tests the high-order bit. 1=key is down; 0=up.
  7. // '!!' will bool-ize the result.
  8. bool shift = !!( ::GetKeyState(VK_SHIFT) & 0x8000 );

Report this snippet  

You need to login to post a comment.