mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-07 20:20:32 +01:00
add hotkey sub typer
minor bump
This commit is contained in:
parent
48fab684a3
commit
a84754d5ec
@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
__version__ = "0.10.5"
|
__version__ = "0.11.0"
|
||||||
|
@ -7,6 +7,7 @@ import typer
|
|||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
group,
|
group,
|
||||||
|
hotkey,
|
||||||
input,
|
input,
|
||||||
profile,
|
profile,
|
||||||
record,
|
record,
|
||||||
@ -24,6 +25,7 @@ from .alias import AliasGroup
|
|||||||
app = typer.Typer(cls=AliasGroup)
|
app = typer.Typer(cls=AliasGroup)
|
||||||
for module in (
|
for module in (
|
||||||
group,
|
group,
|
||||||
|
hotkey,
|
||||||
input,
|
input,
|
||||||
profile,
|
profile,
|
||||||
record,
|
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