In preview.3, there was a check in the RebindingOperation to see if the control’s value had changed in the event before adding it as a candidate.
// Skip controls that have no effective value change.
// NOTE: This will run the full processor stack and is more involved.
if (!control.HasValueChangeInState(statePtr))
continue;
This was removed in preview.4 and, as a result, I now immediately get dozens of candidates on my HOTAS Warthog Throttle due to many switches being “on”. They’re all named Button##, so it’s not easy to tell them apart. Before, I could just toggle the one I want and it would be the only one to show up.
I’ve had to work around this by adding an OnComputeScore callback that does the value change check and returns a very low score if it hasn’t changed. Then in OnPotentialMatch, I have to filter out all the candidates with low scores.
.OnComputeScore(
(c, e) =>
{
unsafe
{
var statePtr = c.GetStatePtrFromStateEvent(e);
// Skip controls that have no effective value change.
// NOTE: This will run the full processor stack and is more involved.
if (!c.HasValueChangeInState(statePtr))
return -100f;
// Otherwise do the normal scoring
var score = c.EvaluateMagnitude(statePtr);
if (!c.synthetic)
score += 1f;
return score;
}
})
Is there a reason this check was removed and is there a better / easier workaround?