Skip to content

inputInjector mouse click erroe #2462

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

Open
2 tasks
chungheecha opened this issue Apr 29, 2022 · 4 comments
Open
2 tasks

inputInjector mouse click erroe #2462

chungheecha opened this issue Apr 29, 2022 · 4 comments
Assignees
Labels
area-Input bug Something isn't working regression

Comments

@chungheecha
Copy link

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

image

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

@chungheecha chungheecha added the bug Something isn't working label Apr 29, 2022
@ghost ghost added the needs-triage label Apr 29, 2022
@chungheecha
Copy link
Author

I found that
error happens when arguments is more than 1.
inputInjector.InjectMouseInput(new[] { down }); ===> not error happen

@ojhad ojhad transferred this issue from microsoft/microsoft-ui-xaml May 3, 2022
@michael-hawker
Copy link

michael-hawker commented Jun 15, 2022

+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).

@michael-hawker
Copy link

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.

@MichaelBakker
Copy link

MichaelBakker commented May 23, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Input bug Something isn't working regression
Projects
None yet
Development

No branches or pull requests

7 participants