Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate input in UWP app

Tags:

c#

windows-10

uwp

Is it possible to simulate keyboard and mouse input programattically in UWP applications?

If it is - how?

I've found solutions for Windows Forms only.

like image 285
Alexander Avatar asked Apr 23 '17 18:04

Alexander


People also ask

Does UWP use XAML?

Topics in this section also document the XAML language as it's used by the UWP and basic to advanced scenarios about how to use XAML to define the UI for your UWP app.

Does UWP have a future?

The current trend is that UWP's internal components (WinUI/MSIX) are being expanded to support non-UWP scenarios, so UWP should remain active in the coming years, and we can see how far it goes.

Are UWP apps fast?

Not every one of them, apps like UWP Notepad and the new Paint loads fast. But most of them like clock, photos, to do, mail, calendar etc. are very slow (they are working fine but takes much time to load). Although I have a low end laptop, even Visual Studio & Eclipse load faster than apps like Calendar & Photos.

Does UWP use Win32?

A common API surface across all devicesA UWP app written in C++/WinRT has access to the Win32 APIs that are part of the UWP. These Win32 APIs are implemented by all Windows devices.


1 Answers

Take a look at the classes in the Windows.UI.Input.Preview.Injection namespace for this:

https://docs.microsoft.com/en-us/uwp/api/windows.ui.input.preview.injection

Thanks, Stefan Wick - Windows Developer Platform

like image 161
Stefan Wick MSFT Avatar answered Nov 10 '22 16:11

Stefan Wick MSFT