Guest User

Untitled

a guest
Jul 11th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. void KeyDown (UINT Key) {
  2.    INPUT Input;
  3.    ZeroMemory(&Input, sizeof(Input));
  4.    Input.type = INPUT_KEYBOARD; // keyboard
  5.    Input.ki.wVk =(WORD) Key; // Virtual Key
  6.    Input.ki.dwFlags = 0;
  7.    
  8.    SendInput(1, &Input, sizeof(INPUT));
  9. }
  10.  
  11. void KeyUp (UINT Key) {
  12.    INPUT Input;
  13.    ZeroMemory(&Input, sizeof(Input));
  14.    Input.type = INPUT_KEYBOARD; // keyboard
  15.    Input.ki.wVk =(WORD) Key; // Virtual Key
  16.    Input.ki.dwFlags = KEYEVENTF_KEYUP;
  17.    
  18.    SendInput(1, &Input, sizeof(INPUT));
  19. }
Add Comment
Please, Sign In to add comment