input: report the release edge of custom bindings - #416
Open
schlegp wants to merge 1 commit into
Open
Conversation
Supreeeme
reviewed
Sep 2, 2026
Comment on lines
+1092
to
+1097
| /// Half-Life: Alyx binds its grab action this way - grip as a `trigger` mode click, which becomes a | ||
| /// native binding, and trigger as a `button` mode click, which becomes a threshold on | ||
| /// trigger/value. Releasing the threshold binding used to fall back to reporting the native | ||
| /// binding's state: the action correctly read as no longer held, but `bChanged` was false and | ||
| /// `fUpdateTime`'s companion `last_change_time` came from whenever the *grip* last moved. Alyx | ||
| /// never saw the release edge, so held objects dropped straight down instead of being thrown. |
Owner
There was a problem hiding this comment.
This can go in the commit message instead of this comment.
| } | ||
|
|
||
| /// Ranking used to decide which of an action's bindings should represent it. Highest wins. | ||
| fn binding_rank(state: &xr::ActionState<bool>) -> (bool, bool, i64) { |
Owner
There was a problem hiding this comment.
I think it would be simpler if this just took two action states and returned the "highest" one, which should probably just be which of the last_change_times is the latest.
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.
Was investigating why throwing items in Half-Life: Alyx only worked with the grip grab and not the trigger/pinch grab.
Alyx binds its grab action (/actions/interact/in/use) to two inputs at once. In bindings_touch.json the grip is a trigger mode click, which xrizer binds natively, and the trigger is a button mode click, which becomes a threshold binding on trigger/value.
GetDigitalActionData only adopted the custom binding's state while it was held. Releasing the trigger failed that condition, so it fell back to reporting the natively bound grip instead. The action correctly read as no longer held, but bChanged was false and last_change_time came from whenever the grip last moved — tracing it, the timestamp reported on a trigger release was literally the previous grip release's. Alyx appears to act on that release edge, so it never threw the object, it just let go of it. Grip grabs worked because there the native binding was the one that changed.
Both candidates are now ranked: a pressed binding wins, and between two unpressed ones the one that changed during this sync wins. Applied the same rule in the two places that pick among an action's custom bindings and between hands, which previously fell back to whichever candidate came first.
Includes a regression test using the same binding shape (one native click, one threshold binding). Against the old code it fails with bChanged: false.
Fixes throwing in Alyx (Issue #281). Haven't checked other games as I don't have other similar ones to play.