WindowsAppSDK
WindowsAppSDK copied to clipboard
inputInjector mouse click erroe
Describe the bug
var down = new InjectedInputMouseInfo();
down.MouseOptions = InjectedInputMouseOptions.LeftDown;
var up = new InjectedInputMouseInfo();
up.MouseOptions = InjectedInputMouseOptions.LeftUp;
inputInjector.InjectMouseInput(new[] { down, up });
cause error below
It worked at ProjectReunion 0.84. After update 1.0 ans later error happaned
Steps to reproduce the bug
Please kindly check whether mouese click (Leftdown & up) works.
Expected behavior
No response
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.0.3
Windows app type
- [ ] UWP
- [ ] Win32
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response
I found that error happens when arguments is more than 1. inputInjector.InjectMouseInput(new[] { down }); ===> not error happen
+1 - Was just about to look into seeing if the InputInjector
API works with the Windows App SDK for some testing work we're investigating for the Windows Community Toolkit. We haven't updated to 1.1 yet either, but will report back with any other info I find on this topic (working or not working).
I was having a hard time seeing anything with 1.0.3, with my test it almost seems like the content is saying it's loaded but hasn't been rendered yet. 1.1.1 seems a bit better, and I see a touch interaction with my app now; however, it's in the wrong spot.
Some code running on UWP works fine, so not sure if it's a DPI issue, the return of some bounds issue, or the translation of the point to the screen in the pointer injection API.
Happy to share our test project example setup for running this in UWP and WinAppSDK with someone. @kevinguo305 want me to reach out to you?
Would like to understand what's different here, as we want to use this API to validate controls for the Windows Community Toolkit work the same across UWP and WinUI 3. This would be a blocker for us. It may not be the exact same issue as the one reported above, but certainly similar or related.
In WindowsAppSDK 1.3.230502000 this problem still exists. Occurred on x64 Windows 11 Business, Version 22H2, Build 22621.1702. Both elevated and non-elevated execution.
at ABI.Windows.UI.Input.Preview.Injection.IInputInjectorMethods.InjectMouseInput(IObjectReference -obj, IEnumerable`1 input)
at Windows.UI.Input.Preview.Injection.InputInjector.InjectMouseInput(IEnumerable`1 input)
Also, it seems to work only once. if an InputInjector is created and used a second time no mouse input is simulated (without failure).