Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion WinSyncScroll/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,20 @@ private async Task RunMouseEventProcessingLoopAsync(
if (!_options.Value.IsLegacyModeEnabled)
{
LogSendInput(inputs);
PInvoke.SendInput(inputs.AsSpan(), SizeOfInput);
var sentCount = PInvoke.SendInput(inputs.AsSpan(), SizeOfInput);

if (sentCount != inputs.Length)
{
var lastError = Marshal.GetLastWin32Error();
Comment thread
magicxor marked this conversation as resolved.
_logger.LogError("SendInput failed: expected to send {ExpectedCount} events, but only {SentCount} were sent. Last Win32 error: {LastError}",
inputs.Length,
sentCount,
lastError);
}
else
{
_logger.LogTrace("Successfully sent {SentCount} input events", sentCount);
}
}
else
{
Expand Down
Loading