-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor handling of "discrete" vs. "continuous" controls. #108
Comments
The supported parameters should be part of the new action contract. Previously we've used things like JSON schemas to model parameters, which allows both input validation and UI generation. Given that the range of options is somewhat more constrained here, we might try for a simpler definition, which describes:
We could also use our FSS variation on JSON schemas informally without using the validation infrastructure, i.e. only using it for UI generation. We could add a schema-linting step to our tests as a safety check, without having to inject AJV and a bunch of fluid-json-schema code into the page. |
The following should only support "discrete" operation:
The rest should support both "discrete" and "continuous" operation:
The following "axes" actions should be reviewed to ensure that they are basically triggering the same code as their "discrete" equivalents:
This suggests making an axis simply a predefined "paired action" grouping. These groupings should still be capable of operating in "discrete" mode, so that users who can only slowly release a thumb stick have the option to only have the action for a given direction trigger once. |
I ended up refactoring all action handling so that only the The net result is that nearly all thumb stick and button actions are repeatable (actions like "click" and "open new window" are intentionally not repeatable). For actions that are allowed to repeat, the user can configure whether (and how often) they repeat. |
…labGH-109 fluid-labGH-115: Refactored configuration interface and reworked binding structure and execution.
…port for repeatRate.
…tax, and added tests for polling activities like repeating actions.
Currently, we have two kinds of controls. The first are "discrete" controls, that fire when the control value is above the cutoff. Because there is no checking for "already on", these controls can be called repeatedly (and rapidly) when an analog button like a trigger is used.
The second are "continuous" controls, which poll for updates and keep firing the action as long as the value is still above the cutoff threshold. These can only be bound to "axes" at the moment. In cases like scrolling, the value is also used to determine how hard/fast to move, so that gentle thumb stick deflection scrolls slowly, and full deflection scrolls quickly.
For both types of action, each action models its own value handling, which results in a lot of duplicated code and inconsistent behaviour. We should refactor such that:
This would be a good time to standardise the contract for actions in general, so that we don't have a method signature with every possible parameter, and instead pass an action options object for each call.
The text was updated successfully, but these errors were encountered: