This library is a layer on top of Friendly, so you must learn that first. But it is very easy to learn.
https://github.com/Codeer-Software/Friendly.Windows
Key mouse emulation can be performed on Windows applications at high speed and with high accuracy. This library is built on Friendly Layer. Valid for applications created with Win32, WinForms, WPF.
Please use it with these. Codeer.Friendly.Windows.NativeStandardControls Ong.Friendly.FormsStandardControls RM.Friendly.WPFStandardControls
PM> Install-Package Codeer.Friendly.Windows.KeyMouse
These are extension methods.
usingCodeer.Friendly.Windows.KeyMouse;Keybord emulate.
varwindow=WindowControl.FromZTop(app);vartarget=newFormsTextBox(window.Dynamic()._keyTest);//The argument is the same specification as System.Windows.Forms.SendKeys.target.SendKeys("aBc");//CONTROL + Qtarget.SendControlAndKey(Keys.Q);//SHIFT + Qtarget.SendShiftAndKey(Keys.A);//ALT + Qtarget.SendAltAndKey(Keys.Q);//CONTROL + SHIFT + ALT + Qtarget.SendModifyAndKey(true,true,true,Keys.Q);Mouse emulate.
varwindow=WindowControl.FromZTop(app);vartarget=newWindowControl(window.Dynamic()._mouseTest);//Left click. The coordinates are the center of the control.target.Click();//Specify button and specify client coordinates.target.Click(MouseButtonType.Middle,newPoint(4,5));//Double click.target.DoubleClick();target.DoubleClick(MouseButtonType.Middle,newPoint(4,5));//Drag & Drop.vardropTarget=newWindowControl(window.Dynamic()._dropTest);target.MouseDown(MouseButtonType.Left,newPoint(0,0));dropTarget.MouseUp(MouseButtonType.Left,newPoint(2,3));Keybord and Mouse emulate.
varwindow=WindowControl.FromZTop(app);vartarget=newWindowControl(window.Dynamic()._keyMouseTest);//ALT + MouseClick;app.KeyDown(Keys.Menu);target.Click():
app.KeyUp(Keys.Menu);