Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add small time delay between press and release #65

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions streamdeck_ui/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Defines the Python API for interacting with the StreamDeck Configuration UI"""
import json
import os
import time
import threading
from functools import partial
from subprocess import Popen # nosec - Need to allow users to specify arbitrary commands
Expand Down Expand Up @@ -35,6 +36,7 @@ def _key_change_callback(deck_id: str, _deck: StreamDeck.StreamDeck, key: int, s
for section in keys.split(","):
for key_name in section.split("+"):
keyboard.press(getattr(Key, key_name.lower(), key_name))
time.sleep(0.5)
for key_name in section.split("+"):
keyboard.release(getattr(Key, key_name.lower(), key_name))

Expand Down