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
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: tests

on:
push:
branches: [master]
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# The Linux backend only touches /dev/input from init(), so the suite
# imports and runs unprivileged against the fake backend, as on Windows.
os: [windows-latest, ubuntu-latest]
python-version: ['3.11', '3.13']
include:
# ubuntu-latest no longer ships 3.8, the oldest version claimed by
# requires-python, so pin the older runner for that one job.
- os: ubuntu-22.04
python-version: '3.8'
- os: windows-latest
python-version: '3.8'

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .

- name: Run tests
run: python -m pytest tests/ -v --ignore=tests/manual

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Build and check the distribution
run: |
python -m pip install --upgrade pip
pip install build twine
python -m build
twine check dist/*
23 changes: 23 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 1.0.0

First release of `directkeys`, a fork of [boppreh/keyboard](https://github.com/boppreh/keyboard) 0.13.5.
The API is unchanged, so migrating is usually just a matter of changing the import.

New features:

- [Windows] Configurable AltGr abstraction via `set_alt_gr_abstraction()` and
`get_alt_gr_abstraction_state()`. Enabled by default, it reports the
Right Alt + synthetic Left Ctrl pair as a single `alt gr` event; disable it
to see the raw events.
- [Windows] `get_stuck_keys()` reports modifiers left held down, and
`force_reset_keyboard()` releases them. Useful after a program crashes
without releasing a key it pressed.
- `KeyboardEvent.flags` exposes the low-level hook flags, and is included in
`to_json()`. On Windows it currently carries the `LLKHF_EXTENDED` bit.

Packaging:

- Renamed the package and the distribution to `directkeys`.
- Metadata moved to `pyproject.toml`; Python 3.8+ is required.


# 0.13.5

- Added LICENSE.txt file to PyPI packages.
Expand Down
1 change: 1 addition & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2016 BoppreH
Copyright (c) 2025 WigoWigo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include CHANGES.md
include README.md
include LICENSE.txt
include LICENSE.txt
include pyproject.toml
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
test:
python -m pytest tests/ --cov=directkeys --cov-report=html

build: tests directkeys setup.py README.md CHANGES.md MANIFEST.in
build: tests directkeys pyproject.toml README.md CHANGES.md MANIFEST.in
python ../docstring2markdown/docstring2markdown.py directkeys "https://github.com/WigoWigo10/keyboard/blob/master" > README.md
find . \( -name "*.py" -o -name "*.sh" -o -name "* .md" \) -exec dos2unix {} \;
python setup.py sdist --format=zip bdist_wheel && twine check dist/*
python -m build && twine check dist/*

release:
python make_release.py
Expand Down
Loading
Loading