Replace remaining raw ctypes calls to hid.dll with winBindings.hid definitions.#18902
Merged
Conversation
…ey were the same. They actulaly differ in some of their members, though they do end up being the same size. We now define correct HIDP_BUTTON_CAPS and use it where appropriate.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces raw ctypes calls to hid.dll with properly defined winBindings.hid functions to support the transition to 64-bit architecture. The changes add structured function definitions with proper type annotations and correct structure usage.
- Add comprehensive winBindings definitions for remaining hid.dll functions
- Replace all raw ctypes.windll.hid calls with winBindings.hid equivalents
- Correct HIDP_BUTTON_CAPS structure definition and usage (previously incorrectly used HIDP_VALUE_CAPS)
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| source/winBindings/hid.py | Adds 10 new HID function definitions with proper type annotations and documentation |
| source/hwIo/hid.py | Replaces raw ctypes calls with winBindings equivalents and fixes structure types |
| source/hidpi.py | Adds correct HIDP_BUTTON_CAPS structure and improves type safety with from_param method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SaschaCowley
requested changes
Sep 12, 2025
SaschaCowley
left a comment
Member
There was a problem hiding this comment.
Please also add to changes.md where necessary.
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
SaschaCowley
approved these changes
Sep 15, 2025
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.
Link to issue number:
None.
Summary of the issue:
A pa part of moving to 64 bit, all raw ctypes calls must have explicit definitions. Remaining calls to functions in hid.dll must be moved to winBindings.
Description of user facing changes:
None.
Description of developer facing changes:
Description of development approach:
Testing strategy:
General smoke testing with a standard HID braille display. auto detection, moving by line, routing etc.
Known issues with pull request:
None known.
Code Review Checklist: