Refactor input event handling to improve payload extraction and update struct documentation to prevent test crash#1
Merged
bstudtma merged 2 commits intobstudtma:add-simvar-subscriptionfrom Sep 15, 2025
Conversation
…e struct documentation to prevent test crash
…ANGELOG with new features, fixes, and notes
Author
|
@bstudtma Fixed a bug with tests, and added a changelog for your main PR on SimConnect.NET :) |
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.
This pull request refactors how subscribed input event notifications are processed and represented in memory. The main change is to treat the event structure as a header, with the value payload directly following it, improving compatibility and correctness when extracting event values.
Improvements to event value extraction:
ProcessSubscribeInputEvent, the code now computes the payload pointer and size based on the header, then extracts the value according to the event type, handling doubles and strings more robustly and safely.Struct definition and memory layout:
[StructLayout(LayoutKind.Sequential)]toSimConnectRecvSubscribeInputEventto ensure correct memory layout for interop.Valuefield fromSimConnectRecvSubscribeInputEvent, making it a pure header and clarifying that the value payload follows the header in memory.