OBS未从python脚本接收热键 [英] OBS doesn't receive hotkey from python script

查看:133
本文介绍了OBS未从python脚本接收热键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过让python脚本搜索屏幕上的特定图像来在OBS中进行自动场景转换.当检测到图像时,python脚本将发送热键,该热键应由OBS选择(在程序中添加了相同的热键).

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).

但是,我在chrome/notepad/某些游戏/etc等各种应用程序中尝试了此操作,并且热键确实被传输"了,但是OBS却不接受它们.我不知道为什么,有什么帮助吗?

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 ?

推荐答案

来自此线程:按键Python

似乎您需要安装pywin32模块.这样,您就可以将按键发送到其他应用程序:

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

这篇关于OBS未从python脚本接收热键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆