Skip to content

Clarify Raw Input reading behavior and usage patterns#2168

Merged
Karl-Bridge-Microsoft merged 9 commits into
MicrosoftDocs:docsfrom
DJm00n:patch-12
Mar 18, 2026
Merged

Clarify Raw Input reading behavior and usage patterns#2168
Karl-Bridge-Microsoft merged 9 commits into
MicrosoftDocs:docsfrom
DJm00n:patch-12

Conversation

@DJm00n
Copy link
Copy Markdown
Contributor

@DJm00n DJm00n commented Mar 18, 2026

This PR corrects and clarifies the Raw Input documentation.

Changes

  • Add note that GetMessage removes WM_INPUT from the raw input queue before returning, making it invisible to GetRawInputBuffer
  • Document the correct pattern: call GetRawInputData(lParam) first, then drain with GetRawInputBuffer in a loop
  • Note that background input requires RIDEV_INPUTSINK
  • Replace outdated samples: remove Sleep(1000) workaround, fix cbSize * 16 buffer guess, remove DefRawInputProc no-op
  • Add timer-based batched read sample using PeekMessage range filters

See also MicrosoftDocs/sdk-api#2190

Updated the documentation for raw input handling, replacing sections on buffered reads with new sections on reading raw input from a WM_INPUT handler and performing batched reads using a timer.
@prmerger-automator
Copy link
Copy Markdown
Contributor

@DJm00n : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

DJm00n added 4 commits March 18, 2026 16:00
Updated the raw input handling code and improved explanations for reading raw input from devices.
Updated the raw input handling code to improve clarity and efficiency. Added optional phase for draining additional input events from the queue.
@DJm00n DJm00n changed the title Revise raw input documentation sections Clarify Raw Input reading behavior and usage patterns Mar 18, 2026
DJm00n added 3 commits March 18, 2026 18:02
Updated raw input handling to support keyboard and mouse devices, improved buffer management, and refined message loop for better event processing.
Refactor raw input handling to use a static buffer instead of dynamic allocation. This change improves memory management and simplifies the input processing logic.
@Karl-Bridge-Microsoft Karl-Bridge-Microsoft merged commit fcb7259 into MicrosoftDocs:docs Mar 18, 2026
1 check passed
@DJm00n DJm00n deleted the patch-12 branch March 19, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants