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)
