Advertisement
Fiszu

Y to Z

Dec 4th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. void Y();
  7. void Z();
  8. void Backspace();
  9. bool potw = false,potw2= false;
  10. int main()
  11. {
  12.     cout<<"Witam was kochane politechy!!!"<<endl;
  13.      cout<<"Teraz wasze Z to Y i wasze Y to Z Zostawcie ten program wlaczony"<<endl;
  14.  
  15.     while(1)
  16.     {
  17.  
  18.          if(GetAsyncKeyState('Y') && potw2==true)
  19.         {
  20.             if( potw == true)
  21.             {
  22.  
  23.  
  24.         potw = false;
  25.  
  26.         Backspace();
  27.         Z();
  28.             }
  29.         }
  30.         else
  31.             potw=true;
  32.  
  33.         if(GetAsyncKeyState('Z') && potw==true)
  34.         {
  35.             if( potw2 == true)
  36.             {
  37.             potw2=false;
  38.         Backspace();
  39.         Y();
  40.             }
  41.         }
  42.         else
  43.             potw2 = true;
  44.  
  45.     }
  46.  
  47.  
  48.     return 0;
  49. }
  50.  
  51.  
  52. void Backspace()
  53. {
  54.    
  55.          keybd_event( VK_BACK,0x45,KEYEVENTF_EXTENDEDKEY | 0, 0 );
  56.  
  57.      
  58.          keybd_event( VK_BACK,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
  59. }
  60.  
  61. void Y()
  62. {
  63.    
  64.          keybd_event( 0x59,0x45,KEYEVENTF_EXTENDEDKEY | 0, 0 );
  65.  
  66.      
  67.          keybd_event( 0x59,0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
  68. }
  69. void Z()
  70. {
  71.         keybd_event( 0x5A,0x45,KEYEVENTF_EXTENDEDKEY | 0, 0 );
  72.  
  73.  
  74.          keybd_event( 0x5A,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement