Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define WINVER 0x0500
- #include <windows.h>
- int main(int argc, char *argv[]){
- //inisialisasi keyboard
- INPUT ip;
- ip.type = INPUT_KEYBOARD;
- ip.ki.wScan = 0;
- ip.ki.time = 0;
- ip.ki.dwExtraInfo = 0;
- tekanCTRL();
- tekanESC();
- lepasCTRL();
- lepasESC();
- tekanTAB();
- lepasTAB();
- getch();
- return 0;
- }
- //tekan ctrl
- void tekanCTRL(){
- ip.ki.wVk = VK_CONTROL;
- ip.ki.dwFlags = 0;
- SendInput(1, &ip, sizeof(INPUT));
- }
- //lepas ctrl
- void lepasCTRL(){
- ip.ki.wVk = VK_CONTROL;
- ip.ki.dwFlags = KEYEVENTF_KEYUP;
- SendInput(1, &ip, sizeof(INPUT));
- }
- //tekan escape
- void tekanESC(){
- ip.ki.wVk = VK_ESCAPE;
- ip.ki.dwFlags = 0;
- SendInput(1, &ip, sizeof(INPUT));
- }
- //lepas escape
- void lepasESC(){
- ip.ki.wVk = VK_ESCAPE;
- ip.ki.dwFlags = KEYEVENTF_KEYUP;
- SendInput(1, &ip, sizeof(INPUT));
- }
- void tekanTAB(){
- ip.ik.wVk = VK_TAB
- ip.ik.dwFlags = 0;
- SendInput = (1, &i, INPUT);
- }
- void lepasTAB(){
- ip.ik.wVk = VK_TAB;
- ip.ik.dwFlags = KEYEVENTF_KEYUP;
- SendInput(1, &i, INPUT);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement