Skip to content

Fix GetInputEventAsync#7

Merged
AussieScorcher merged 2 commits intostopbars:mainfrom
bstudtma:fix-getinputevent
Aug 23, 2025
Merged

Fix GetInputEventAsync#7
AussieScorcher merged 2 commits intostopbars:mainfrom
bstudtma:fix-getinputevent

Conversation

@bstudtma
Copy link
Copy Markdown
Contributor

@bstudtma bstudtma commented Aug 23, 2025

Fix GetInputEventAsync to read value bytes dynamically based on type.

Summary

Fixed GetInputEventAsync response handling to read the type and value correctly.

Changes Made

Removed None from SimConnectInputEventType - since it docs seem incorrect. Verified by comparing other code on GitHub and from testing.

Also, C:\MSFS 2024 SDK\SimConnect SDK\include\SimConnect.h shows the enum as:

SIMCONNECT_ENUM SIMCONNECT_INPUT_EVENT_TYPE : DWORD
{
SIMCONNECT_INPUT_EVENT_TYPE_DOUBLE,
SIMCONNECT_INPUT_EVENT_TYPE_STRING
};

Created a new struct for SimConnectRecvGetInputEventHeader without Value

Marshall SimConnectRecvGetInputEventHeader without value and read the value dynamically based on type and remaining bytes.

Fixed setting the Hash based on the requested Hash instead of RequestId from the response.

Additional Information

Tested by enumerating over all available input events and reading each value.

Also, the standard test case should now pass since it detects the double correctly.

Author Information

Discord Username: bstudtma


Checklist:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Fix GetInputEventAsync to read bytes dynamically based on type
Copilot AI review requested due to automatic review settings August 23, 2025 12:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@AussieScorcher
Copy link
Copy Markdown
Member

Really great work, thanks for fixing this :)

@AussieScorcher AussieScorcher merged commit 21f8dc8 into stopbars:main Aug 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants