python simulated keyboard input

Memorandum 

Import
Win32API Import win32con win32api.keybd_event ( 17,0,0,0) # Ctrl key code is a bit. 17 win32api.keybd_event (86,0,0,0) # V-bit key code is 86 win32api.keybd_event (86,0 , win32con.KEYEVENTF_KEYUP, 0) # release button win32api.keybd_event (17,0, win32con.KEYEVENTF_KEYUP, 0)

When some of the common keys below the corresponding key and code:
alphanumeric key numeric keypad keys function keys other keys 
      bonds code code bond bond bond code code 
      A 0 96 65 112 the Backspace Fl. 8 
      B 66. 1 97 F2 of 113 the Tab. 9 
      C 67 2 98 F3 114 the Clear 12 is 
      D 68. 3 99 the F4 115 the Enter 13 is 
      E 69. 4 100 the F5 1 16 the Shift 16 
      F. 70. 5 101 F6 117 Control. 17 
      G 71 is. 6 102 F7 1 18 the Alt 18 is 
      H 72. 7 103 the F8 119 Caps Lock 20 
      I    73          8   104          F9   120      Esc       27 
      J    74          9   105          F10  121     Spacebar    32 
      K   75         *   106           F11  122      Page Up     33 
      L   76         +   107           F12  123      Page Down    34 
      M   77        Enter 108                          End       35 
      N   78         -   109                              Home      36 
      O   79         .   110                              Left Arrow   37 
      P   80         /   111                              Up Arrow    38 
      Q   81                                                Right Arrow   39 
      R   82                                                Down Arrow    40 
      S   83                                                Insert      45 
      T   84                                                Delete      46 
      U   85                                                Help       47 
      V   86                                                Num Lock     144   
      W  87          
      X   88      
      Y   89      
      Z   90      
      0   48      
      1   49      
      2   50       
      3   51       
      4   52       
      5   53       
      6   54       
      7   55       
      8   56       
      9   57

Guess you like

Origin www.cnblogs.com/XingzhiDai/p/11939744.html