Skip to content

Fix SetInputEvent to accept hash as ulong#5

Merged
AussieScorcher merged 1 commit intostopbars:mainfrom
bstudtma:fix-input-events
Aug 22, 2025
Merged

Fix SetInputEvent to accept hash as ulong#5
AussieScorcher merged 1 commit intostopbars:mainfrom
bstudtma:fix-input-events

Conversation

@bstudtma
Copy link
Copy Markdown
Contributor

Send event hash as ulong

Summary

Fixed SetInputEvent to accept hash as ulong

Changes Made

Fixed SetInputEvent to accept hash as ulong

Additional Information

Tested with AS1000_CONTROLPAD_1 on the SR22T sending a value of 0.0

Author Information

Discord Username: bstudtma
VATSIM CID:


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?

Copilot AI review requested due to automatic review settings August 22, 2025 02:03
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.

Pull Request Overview

This PR fixes a data type mismatch in the SimConnect input event handling by changing the hash parameter from uint to ulong in both the native P/Invoke declaration and its usage. This aligns the wrapper with the actual SimConnect SDK requirements and prevents potential data truncation issues when working with input event hashes.

Key Changes

  • Updated P/Invoke signature for SimConnect_SetInputEvent to accept ulong hash parameter
  • Modified all calls to use ulong casting instead of uint casting for the hash parameter

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/SimConnect.NET/SimConnectNative.cs Updated P/Invoke declaration to use ulong for hash parameter
src/SimConnect.NET/InputEvents/InputEventManager.cs Updated method calls to cast hash as ulong instead of uint

@AussieScorcher AussieScorcher merged commit 8227c60 into stopbars:main Aug 22, 2025
2 checks passed
@bstudtma bstudtma deleted the fix-input-events branch August 22, 2025 13:56
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.

4 participants