Repository navigation
tecs.controller: press and release actions when an axis crosses its own threshold - #17
Open
albanmgicquel wants to merge 2 commits into
Open
albanmgicquel wants to merge 2 commits into
albanmgicquel wants to merge 2 commits into
Conversation
A plunger pulled with a stick, or a flipper on a trigger, has to arrive as a key press and a key release, but axis bindings had no edges and one deadzone served the whole controller. An axis binding may now name its own threshold, as in axis:leftY+@0.5: below it the binding reads zero, and crossing it presses the action and falling back releases it. Bindings without a threshold are unchanged. The manager advances the edges in update, which tecs.UpdateControllers runs once a frame in Ingress after device assignment. Fixed steps read latched edges through tecs.EnterFixedControllers and tecs.ExitFixedControllers, as Input's latched key edges are; a standalone manager calls update, enterFixedPhase and exitFixedPhase itself. Levels are read past capture layers, so a menu neither releases a held stick nor presses it again when it closes.
rebind rebuilt each threshold action's edges with the axis up, so a stick held past its threshold read as a new press at the next update. The new edges take the previous level of the same action.
This branch has not been deployed
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.
An axis binding can name its own threshold, as in
axis:leftY+@0.5. Below the threshold it reads zero, and crossing it presses the action and falling back releases it. That lets a stick or a trigger drive a button with real press and release edges: a plunger pulled with a stick, or a flipper on a trigger. Bindings without@are unchanged.Changes
axis:NAME@T,axis:NAME+@Tandaxis:NAME-@T, withTabove zero and at most one. BelowTthe binding reads zero instead of using the controller's deadzone. A directional binding crosses on its own side, and a signed one crosses on either side. An invalid threshold raises when the mapping is created or rebound.isPressedandisReleasedreport threshold crossings alongside the existing digital edges.getRawreads a threshold binding against its own threshold.ControlManager:update(dt). An installed manager runs it once a frame inIngressthrough a new system,tecs.UpdateControllers, aftertecs.AssignControllers.tecs.EnterFixedControllers(FixedFirst) andtecs.ExitFixedControllers(FixedLast) switch queries to latched edges, astecs.inputdoes for key edges. A standalone manager callsupdate,enterFixedPhaseandexitFixedPhaseitself.tests/tecs/compatibilitytest.nupp.Tests
nupp checkandnupp task format-checkare clean,nupp testpasses all 1,061 tests in 88 suites, andtest-toolspasses 10.verify(ex-hostthroughex-shapes, 5 frames each) exit 0.docs-checkdoesn't run in my local setup: it stops on a missinglunamarkrock in the Nupp checkout, andmainstops there too. The Rust gates weren't run, since this PR changes no Rust.