Praxis_Bot/hotkey_script.py
dtookey 453c1de0cc Let PEP8 do it's thing and reformat all the files.
Removed bots.py and slurs.py and moved them into config.py. twitch_script_class.py has been updated to handle this
added a test harness for twitch_script_class.py
contains_url and contains_slur are both validated
refactored contains_url to use a simple(ish) regex instead of an if cascade
2020-09-20 11:40:51 -04:00

19 lines
397 B
Python

import pygetwindow as gw
from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
def focusOBS():
gw.Win32Window.activate(gw.getWindowsWithTitle('OBS')[0])
def hotkey_trigger(key_input):
time.sleep(1)
focusOBS()
time.sleep(1)
with keyboard.pressed(Key.ctrl, Key.shift, Key.alt):
keyboard.press(key_input)
keyboard.release(key_input)