Add support for nudging devices#1
Merged
Merged
Conversation
- Sign-extend raw usage values from the report bit width when the logical range is signed (HidP_GetUsageValue does not sign-extend), fixing full-scale spikes for negative accelerometer readings. - Skip null-state readings on axes that declare HasNull. - Wait for cancelled overlapped reads to complete before freeing the OVERLAPPED and report buffer on device close. - Guard key bindings with a mutex against concurrent rebinding. - Serve device/axis listings from the live polling snapshot so device indices stay consistent with axis events. - Keep the timestamp epoch stable across re-initialization and guard against uninitialized QPC frequency. - Open devices with zero access rights for listing-only queries.
Greptile SummaryThis PR adds native HID axis support for nudge devices. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "input: tighten protocol and Windows buil..." | Re-trigger Greptile |
Devices unplugged mid-session used to leave a dead handle retrying a failing ReadFile every poll tick, and devices plugged in after polling started were never seen until restart. - Detect removal via read failures: close the handle, mark the slot disconnected and request reconciliation. - Probe the present HID interface list (CM_Get_Device_Interface_ListW, much cheaper than a SetupDi pass) every 2s; reconcile only when the list actually changed or a read failed, with a 250ms debounce on failure-triggered checks and retries for transient open failures. - Reconciliation keeps device indices stable: missing devices keep their slot and report isConnected=0, re-plugged devices reopen in place, new joystick-style devices are appended. - Emit VPE_INPUT_EVENT_DEVICES_CHANGED through the existing callback so consumers know to refresh their device list; the event layout is unchanged and older consumers ignore the new type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds native HID axis support for cabinet nudge hardware, especially KL25Z / Pinscape-style accelerometer devices.