1

I am trying to do automatic scene changer in OBS by having a python script search for a specific image on screen. When the image is detected, the python script will send the hotkey, which should be picked by OBS (Same hotkey added in program).

However, I tried this in various applications like chrome/notepad/some games/etc and the hotkeys DO get "transmitted", but OBS doesn't pick them up. I don't know why, any help ?

enter image description here

enter image description here

Alex TheWebGroup
  • 175
  • 2
  • 12

1 Answers1

1

From this thread: Key Presses in Python

It seems like you need to install pywin32 module. With that you can send key presses to other applications:

import win32com.client as comclt
wsh= comclt.Dispatch("WScript.Shell")
wsh.AppActivate("Notepad") # select another application
wsh.SendKeys("a") # send the keys you want
Kevin Müller
  • 722
  • 6
  • 18