【问题标题】:OBS Studio python hotkeyOBS Studio python 热键
【发布时间】:2020-10-11 08:32:47
【问题描述】:

我目前正在尝试学习如何为 OBS Studio 编写 Python 脚本。我正在尝试设置一个热键,您可以在 OBS 中选择/更改,但我无法找到任何教程或已经存在的脚本。 (可能已经有这个脚本了,我只是没找到)

有人可以帮忙吗?

【问题讨论】:

    标签: python obs


    【解决方案1】:

    对于 Python,也许这会有所帮助: OBS doesn't receive hotkey from python script

    我无法帮助您使用 python,但如果您使用的是 Mac,您可以使用 AppleScript 来控制它。

    下面的脚本就是一个例子。

    我有一个外置的 midi 控制器 (MPC) 用于此目的,但也有带功能键的键盘。

    on runme(message)
    
    tell application "OBS"
        activate
    end tell
    
    #say item 2 of message
    
    #PAD 1 = 37
    
    if (item 2 of message = 37)
        tell application "System Events"
            keystroke "s" using control down
        end tell
    end if
    
    #PAD 2 = 36
    
    if (item 2 of message = 36)
        tell application "System Events"
            keystroke "b" using control down
        end tell
    end if
    
    #PAD 3 = 42
    
    if (item 2 of message = 42)
        tell application "System Events"
            keystroke "p" using control down
        end tell
    end if
    
    #4 = 54
    
    if (item 2 of message = 54)
        tell application "System Events"
            keystroke "1" using control down
        end tell
    end if
    
    #5 = 40
    
    if (item 2 of message = 40)
        tell application "System Events"
            keystroke "2" using control down
        end tell
    end if
    
    #6 = 38
    #7 = 46
    #8 = 44
    
    
    
    
    end runme
    

    【讨论】:

      猜你喜欢
      • 2019-08-07
      • 2019-06-17
      • 2018-01-06
      • 1970-01-01
      • 1970-01-01
      • 2015-08-07
      • 2018-03-02
      • 1970-01-01
      • 2016-05-10
      相关资源
      最近更新 更多