Skip to content
Merged
Show file tree
Hide file tree
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: 1 addition & 1 deletion .github/workflows/auto-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ["3.15"]

env:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
# Bleach is EOL, Plan to replace with NH3
"flask~=3.0",
"markdown~=3.6",
"keyboard~=0.13.5",
"keyboard~=0.13.5; sys_platform == 'win32'",
"ducktools-classbuilder>=0.7.4",
"waitress~=3.0",
"platformdirs~=4.3",
Expand Down
10 changes: 8 additions & 2 deletions src/splitguides/hotkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

This is a rewrite of the relevant functions to handle this.
"""

import sys
import queue as _queue

from ducktools.classbuilder.prefab import prefab, attribute, SlotFields
import keyboard

IS_WINDOWS = sys.platform == "win32"

if IS_WINDOWS:
import keyboard


KEY_DOWN = "down"
Expand All @@ -34,6 +38,8 @@ def read_hotkey(suppress: bool = True) -> Hotkey:
"""
# This function is only ever called in windows

assert IS_WINDOWS, "This should never be called on non-windows platforms"

queue = _queue.Queue()

# Replace lambda with
Expand Down
1 change: 0 additions & 1 deletion src/splitguides/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ducktools.classbuilder.prefab import prefab, attribute, as_dict, is_prefab_instance, get_attributes

from .hotkeys import hotkey_or_none, Hotkey
from .exceptions import UnsupportedPlatformError

PROJECT_NAME = "splitguides"

Expand Down
3 changes: 2 additions & 1 deletion src/splitguides/ui/hotkey_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import json
from collections.abc import Callable

import keyboard
from PySide6 import QtCore

from ducktools.classbuilder.prefab import as_dict
Expand All @@ -23,6 +22,8 @@

IS_WINDOWS = sys.platform == "win32"

if IS_WINDOWS:
import keyboard

class HotkeyManager(QtCore.QObject):
hotkey_signal = QtCore.Signal(str)
Expand Down
Loading
Loading