CommunityToolkit / Labs-Windows

A safe space to collaborate and engineer solutions from the prototyping stage all the way through polished finalized component for the Windows Community Toolkit.
Other
346 stars 51 forks source link

Finish InputInjection Work + Fluent API Helper #176

Open michael-hawker opened 2 years ago

michael-hawker commented 2 years ago

Following on from #124 and #161, we're waiting for 1.1.2 of WinAppSDK or beyond to make progress on this front due to blocking issues with CI and MSTest Discovery. (Also see https://github.com/MicrosoftDocs/windows-uwp/issues/3887)

Once those are resolved in the WinAppSDK we can resume investigating our InputInjection approach which appears to work (at least for mouse click) without issue on UWP.

From original thread comment:

Thanks @Sergio0694, yeah I was roughly thinking something like:

await SimulateInput.StartTouch()
                   .MouseDown(coord)
                   .MouseMove(cx, cy, seconds: 0.5, points: 10)
                   .MouseUp()
                   .Execute();

As we need to preface and end the operation with initializing/uninitializing the touch injector code, as well as generate/use a unique pointer id across the instructions (and if we want to use relative positioning between operations keep track of the initial point).

Anyway, bit more investigation to do, as not sure if this is going to run in the CI yet (though even then may have value).

Originally posted by @michael-hawker in https://github.com/CommunityToolkit/Labs-Windows/issues/124#issuecomment-1157848762

Current work in llama/input-injection-test branch.

michael-hawker commented 2 years ago

Good test cases for Keyboard driven scenarios would be the TokenizingTextBox:

  1. test clearing an inner text box and the text changing
  2. overwriting an existing token and typing a character and ensuring that's set in the textboxes (text and inner box)

See https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/4749#issuecomment-1281611691