【问题标题】:OBS doesn't receive hotkey from python scriptOBS 没有收到来自 python 脚本的热键
【发布时间】:2019-06-17 03:14:12
【问题描述】:

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

但是,我在各种应用程序(如 chrome/notepad/一些游戏/等)中尝试了此操作,并且热键确实被“传输”了,但 OBS 没有接收到它们。我不知道为什么,有帮助吗?

【问题讨论】:

    标签: python hotkeys pynput obs


    【解决方案1】:

    来自这个帖子:Key Presses in Python

    看来您需要安装 pywin32 模块。 有了它,您可以将按键发送到其他应用程序:

    import win32com.client as comclt
    wsh= comclt.Dispatch("WScript.Shell")
    wsh.AppActivate("Notepad") # select another application
    wsh.SendKeys("a") # send the keys you want
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-20
      • 2019-08-07
      • 1970-01-01
      • 1970-01-01
      • 2016-08-07
      • 1970-01-01
      • 2016-08-17
      • 1970-01-01
      相关资源
      最近更新 更多