首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OBS Studio python热键

OBS Studio python热键
EN

Stack Overflow用户
提问于 2020-10-11 16:32:47
回答 2查看 247关注 0票数 0

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

有人能帮帮忙吗?

EN

回答 2

Stack Overflow用户

发布于 2020-12-22 21:39:04

对于Python来说,这可能会有所帮助:OBS doesn't receive hotkey from python script

我不能帮助你使用python,但是如果你使用的是Mac,你可以用AppleScript控制它。

以下脚本就是一个例子。

我有一个外部的midi控制器(MPC),我用它来做这个,但也有带功能键的键盘。

代码语言:javascript
复制
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
票数 0
EN

Stack Overflow用户

发布于 2022-02-07 09:03:02

你使用热键的目的是什么?比如换个场景或者做个过渡?那么,为什么不使用文件中的热键->设置热键

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64302045

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档