Chore/fork identity and hygiene - #3
Merged
WigoWigo10 merged 7 commits intoAug 1, 2026
Merged
Conversation
setup.py publishes `directkeys.__doc__` as the PyPI long_description, and the Makefile regenerates README.md from that same docstring — so the docstring was the single source still advertising the upstream project. It told readers to `pip install keyboard`, pointed every link at boppreh/keyboard, and the README carried the upstream "this project is currently unmaintained" banner, which is the opposite of this fork's premise. - Retitle to directkeys and state up front that this is a maintained fork. - Point install/clone/API links at this repository. - Add a "New in this fork" section and a migration note for `import keyboard`. - Drop the "Python 2 and 3" claim, which contradicts the 3.8+ classifiers. - Rewrite the generated [source] links to this repo and the directkeys package. References to boppreh/mouse and to upstream issues boppreh#20/boppreh#21/boppreh#22 are left alone: they point at a sibling project and at real upstream discussions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ackend
The backend still carried editing instructions left over from when the AltGr
support was pasted in ("COLE ESTAS DUAS FUNCOES DEPOIS DE...", "O resto do
arquivo continua aqui...", "Esta funcao voce ja deve ter no final do
arquivo"), which read as documentation to anyone else opening the file.
Alongside that:
- Remove `_remove_alt_gr_mapping`, which was never called.
- Remove `shift_is_pressed` and `shift_vks`: the global was still being
assigned on every shift event but nothing read it, since `get_modifiers`
queries GetKeyState directly. Same for `ignore_next_right_alt`, only ever
reset and never read.
- Guard the `to_name` mutation in `get_name` with `tables_lock`, matching every
other access to the tables. This also serialises the shared ctypes buffers
used by `get_event_names`.
- Fold the duplicated modifier vk lists in `force_reset_keyboard` and
`get_stuck_keys` into a single `_modifier_vk_names` mapping.
- Restore the two upstream comments explaining the `fake_alt` / VK_PACKET
guard, and move the `__main__` block back to the end of the file.
- Translate the new comments and docstrings to English, matching the rest of
the codebase and the published API docs.
No behaviour change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`set_alt_gr_abstraction`, `get_alt_gr_abstraction_state` and the fallback helpers are part of the published API: docstring2markdown renders them into README.md and setup.py ships the module docstring as the PyPI description, so they were the only Portuguese text in the user-facing documentation. Also correct the feature list: `KeyboardEvent.flags` is masked down to the LLKHF_EXTENDED bit on Windows, so describing it as the raw hook flags overstated what the attribute actually carries. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
setup.py imported the package at build time to read the version and the docstring, which meant a build could fail before install_requires had a chance to provide pyobjc on macOS. Move all metadata to pyproject.toml and reduce setup.py to a shim so legacy invocations keep working. - Read the version statically via `[tool.setuptools.dynamic]`, keeping `directkeys.version` as the single source of truth without importing it. - Take long_description from README.md, which the Makefile already generates from the module docstring. - Declare requires-python >=3.8 to match the classifiers, add 3.13, and use the more specific "POSIX :: Linux" operating system classifier. - Point the Makefile at `python -m build`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CHANGES.md still started at 0.13.5, so the release that renamed the package and added the AltGr, stuck key and flags features had no entry at all. LICENSE.txt keeps the original BoppreH copyright, as the MIT terms require, with the fork's copyright added alongside it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
run_test.py and run_test_2a_crash.py sat at the repository root, where they read like the project's test entry point despite being interactive scripts that block on a human pressing keys on a physical keyboard. Neither keeps a `test_` prefix, so pytest cannot collect them: as test functions their `read_event()` calls would hang the suite waiting for input. The helper script is now resolved relative to __file__ rather than the current working directory, and a module docstring states what the scripts need to run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The repository had no CI at all, which is an awkward gap for a fork whose pitch is that it is the maintained one. Adds a workflow that runs the suite on Windows and Linux across the Python versions declared in requires-python, plus a job that builds the distribution and runs `twine check` on it. tests/manual is excluded: those scripts need a physical keyboard and a human. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.