Skip to content

Commit 8227c60

Browse files
authored
Fix SetInputEvent to accept hash as ulong (#5)
Send event hash as ulong
1 parent bba9ea4 commit 8227c60

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/SimConnect.NET/InputEvents/InputEventManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ await Task.Run(
209209
try
210210
{
211211
Marshal.Copy(valueBytes, 0, valuePtr, valueBytes.Length);
212-
var result = SimConnectNative.SimConnect_SetInputEvent(this.simConnectHandle, (uint)hash, (uint)valueBytes.Length, valuePtr);
212+
var result = SimConnectNative.SimConnect_SetInputEvent(this.simConnectHandle, (ulong)hash, (uint)valueBytes.Length, valuePtr);
213213
if (result != (int)SimConnectError.None)
214214
{
215215
throw new SimConnectException($"Failed to set input event: {(SimConnectError)result}", (SimConnectError)result);
@@ -245,7 +245,7 @@ await Task.Run(
245245
try
246246
{
247247
Marshal.Copy(valueBytes, 0, valuePtr, valueBytes.Length);
248-
var result = SimConnectNative.SimConnect_SetInputEvent(this.simConnectHandle, (uint)hash, (uint)valueBytes.Length, valuePtr);
248+
var result = SimConnectNative.SimConnect_SetInputEvent(this.simConnectHandle, (ulong)hash, (uint)valueBytes.Length, valuePtr);
249249
if (result != (int)SimConnectError.None)
250250
{
251251
throw new SimConnectException($"Failed to set input event: {(SimConnectError)result}", (SimConnectError)result);

src/SimConnect.NET/SimConnectNative.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public static extern int SimConnect_MapInputEventToClientEvent_EX1(
456456
[DllImport("SimConnect.dll")]
457457
public static extern int SimConnect_SetInputEvent(
458458
IntPtr hSimConnect,
459-
uint hash,
459+
ulong hash,
460460
uint cbUnitSize,
461461
IntPtr value);
462462

0 commit comments

Comments
 (0)