我现在正在学习如何为OBS Studio编写python脚本。我正在尝试设置一个热键,你可以在OBS中选择/更改,但我还没有找到任何教程或现有的脚本有这个功能。(这个脚本可能已经存在了,我只是找不到)
有人能帮帮忙吗?
发布于 2020-12-22 21:39:04
对于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发布于 2022-02-07 09:03:02
你使用热键的目的是什么?比如换个场景或者做个过渡?那么,为什么不使用文件中的热键->设置热键
https://stackoverflow.com/questions/64302045
复制相似问题