Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import win32api
- import win32com.client
- import win32con
- import time
- import pythoncom, pyHook
- #win32gui.EnumWindows(openItNow, 'csgo')
- status = True
- def OnKeyboardEvent(event):
- Space = win32api.GetKeyState(0x20)
- global status
- if event.Key == 'Space' and event.MessageName == 'key down' and status == True:
- print('Space pressed')
- elif event.Key == 'F9' and event.MessageName == 'key down':
- try:
- if status == True:
- status = False
- print(status)
- else:
- status = True
- print(status)
- except Exception as err:
- print(str(err) + ' ' + str(status))
- hm = pyHook.HookManager()
- hm.KeyDown = OnKeyboardEvent
- hm.HookKeyboard()
- pythoncom.PumpMessages()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement