Skip to content

Instantly share code, notes, and snippets.

@davidglezz
Created November 4, 2013 23:19
Show Gist options
  • Save davidglezz/7311044 to your computer and use it in GitHub Desktop.
Save davidglezz/7311044 to your computer and use it in GitHub Desktop.
GetKeyState Example
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
bool shift = !!(GetKeyState(VK_SHIFT) & 0x8000);
cout << hex;
while (!( GetKeyState(VK_F7) & 0x8000 ))
{
cout << int(GetKeyState(VK_SHIFT)&0xFFFFFFFF) << '\r';
Sleep(25);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment