mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-08-07 20:21:48 +00:00
Compare commits
3 Commits
b186685e2f
...
5192368ba8
Author | SHA1 | Date | |
---|---|---|---|
5192368ba8 | |||
a84754d5ec | |||
48fab684a3 |
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
# [0.11.0] - 2025-05-22
|
||||
|
||||
### Added
|
||||
|
||||
- hotkey commands, see [Hotkey](https://github.com/onyx-and-iris/obsws-cli?tab=readme-ov-file#hotkey)
|
||||
|
||||
# [0.10.0] - 2025-04-27
|
||||
|
||||
### Added
|
||||
|
35
README.md
35
README.md
@ -452,6 +452,40 @@ obsws-cli virtualcam toggle
|
||||
obsws-cli virtualcam status
|
||||
```
|
||||
|
||||
#### Hotkey
|
||||
|
||||
- list: List all hotkeys.
|
||||
|
||||
```console
|
||||
obsws-cli hotkey list
|
||||
```
|
||||
|
||||
- trigger: Trigger a hotkey by name.
|
||||
|
||||
```console
|
||||
obsws-cli hotkey trigger OBSBasic.StartStreaming
|
||||
|
||||
obsws-cli hotkey trigger OBSBasic.StopStreaming
|
||||
```
|
||||
|
||||
- trigger-sequence: Trigger a hotkey by sequence.
|
||||
- flags:
|
||||
|
||||
*optional*
|
||||
- --shift: Press shift.
|
||||
- --ctrl: Press control.
|
||||
- --alt: Press alt.
|
||||
- --cmd: Press command (mac).
|
||||
|
||||
- args: <key_id>
|
||||
- Check [obs-hotkeys.h][obs-keyids] for a full list of OBS key ids.
|
||||
|
||||
```console
|
||||
obsws-cli hotkey trigger-sequence OBS_KEY_F1 --ctrl
|
||||
|
||||
obsws-cli hotkey trigger-sequence OBS_KEY_F1 --shift --ctrl
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
@ -459,3 +493,4 @@ obsws-cli virtualcam status
|
||||
|
||||
|
||||
[obs-studio]: https://obsproject.com/
|
||||
[obs-keyids]: https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h
|
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = "0.10.5"
|
||||
__version__ = "0.11.0"
|
||||
|
@ -7,6 +7,7 @@ import typer
|
||||
|
||||
from . import (
|
||||
group,
|
||||
hotkey,
|
||||
input,
|
||||
profile,
|
||||
record,
|
||||
@ -24,6 +25,7 @@ from .alias import AliasGroup
|
||||
app = typer.Typer(cls=AliasGroup)
|
||||
for module in (
|
||||
group,
|
||||
hotkey,
|
||||
input,
|
||||
profile,
|
||||
record,
|
||||
|
43
obsws_cli/hotkey.py
Normal file
43
obsws_cli/hotkey.py
Normal file
@ -0,0 +1,43 @@
|
||||
"""module containing commands for hotkey management."""
|
||||
|
||||
import typer
|
||||
|
||||
from .alias import AliasGroup
|
||||
|
||||
app = typer.Typer(cls=AliasGroup)
|
||||
|
||||
|
||||
@app.callback()
|
||||
def main():
|
||||
"""Control hotkeys in OBS."""
|
||||
|
||||
|
||||
@app.command('list | ls')
|
||||
def list(
|
||||
ctx: typer.Context,
|
||||
):
|
||||
"""List all hotkeys."""
|
||||
resp = ctx.obj.get_hotkey_list()
|
||||
typer.echo('\n'.join(resp.hotkeys))
|
||||
|
||||
|
||||
@app.command('trigger | tr')
|
||||
def trigger(
|
||||
ctx: typer.Context,
|
||||
hotkey: str = typer.Argument(..., help='The hotkey to trigger'),
|
||||
):
|
||||
"""Trigger a hotkey by name."""
|
||||
ctx.obj.trigger_hotkey_by_name(hotkey)
|
||||
|
||||
|
||||
@app.command('trigger-sequence | trs')
|
||||
def trigger_sequence(
|
||||
ctx: typer.Context,
|
||||
shift: bool = typer.Option(False, help='Press shift when triggering the hotkey'),
|
||||
ctrl: bool = typer.Option(False, help='Press control when triggering the hotkey'),
|
||||
alt: bool = typer.Option(False, help='Press alt when triggering the hotkey'),
|
||||
cmd: bool = typer.Option(False, help='Press cmd when triggering the hotkey'),
|
||||
key_id: str = typer.Argument(..., help='The hotkey to trigger'),
|
||||
):
|
||||
"""Trigger a hotkey by sequence."""
|
||||
ctx.obj.trigger_hotkey_by_key_sequence(key_id, shift, ctrl, alt, cmd)
|
Loading…
x
Reference in New Issue
Block a user