Questions tagged [inputsimulator]

Input Simulator provides easy-to-use functions for simulating keystrokes or mouse movement especially useful in user interface automation or unit testing.

Example for keyboard input:

var inputSimulator = new InputSimulator();
inputSimulator.Keyboard.KeyDown(VirtualKeyCode.SHIFT);
inputSimulator.Keyboard.KeyPress(VirtualKeyCode.X);
inputSimulator.Keyboard.KeyUp(VirtualKeyCode.SHIFT);

Example for mouse movement:

var inputSimulator = new InputSimulator();
inputSimulator.Mouse.MoveMouseBy(25, -60);

Visit the project's homepage for further information.

17 questions
2
votes
2 answers

InputSimulator smooth linear mouse movement between 2 points

I'm struggling to figure out why the below function is only ever moving my mouse from 0, 0 screen coords, to my final destination, even though Cursor.Position is returning the correct screen coords. If anybody could enlighten me i'd be most…
Spark
  • 1,007
  • 1
  • 8
  • 26
1
vote
1 answer

How to simulate keypress events to change text content and submit a form in JavaScript?

I want to create a JavaScript function that can simulate keypress events to change the text content inside a div and then submit it using a button click event. For example, let's say I have a div with an ID of "myDiv", and I want to change its…
1
vote
1 answer

Sending Keyboard RETURN Key on remote server with Remote Desktop Connection Closed

I have a WinForms WebView2 project that is a simple bot running some JavaScript on a webpage. I am using JS to click an element on the webpage and download a file. The website prompts me with "Are you sure you want to leave the page?" dialog, So I…
mrgucci
  • 37
  • 8
1
vote
1 answer

C# InputSimulator: choosing key from combobox

I have array filled with key names from InputSimulator. readonly string[] keys = new string[119] { "", "TAB", "RETURN", "SHIFT", "CONTROL", ... } After that I fill comboboxes with this…
Andrey
  • 13
  • 3
1
vote
0 answers

Simulating Key Presses

Intro: I'm not really great at programming, just something I'm trying to learn in my spare time and when the opportunity arises for little projects at work. I'm trying to create a basic application which simulates the key presses for (Ctrl + Win…
user11896600
1
vote
1 answer

Can't access Windows Input Simulator in my C# project

After researching about how to control other applications by simulating keyboard, many people suggested that I use "inputsimulator" CodePlex I unzipped the folder and looked for .dll file to reference in my C# project, but I couldn't find…
pioneer
  • 37
  • 8
1
vote
0 answers

Input Simulator TextEntry - Simulates Inline

I use Input Simulator in my C# Form Application. (I use serial port to execute codes) When i execute InputSimulator.Keyboard.TextEntry(textbox.text); on Notepad, it simulates perfectly. But not on any other programs such as Gmail.... How can i make…
1
vote
0 answers

Sending keys fails - Window active

I am sending a keystroke (ctrl+c) to an active Windows using InputSimulator To achive this I minimize my own form and set the application i wish to send the key to the foreground using the WIN32 API and SetForegroundWindow. Now this all works on…
Johannes
  • 441
  • 5
  • 15
1
vote
0 answers

How to prevent a textbox inside Webbrowser control from losing focus when user clicks outside webbrowser control?

I have a winform application in which I have a Virtual Keypad. The following code (with textBox1 as winform textbox works fine: protected void touchScreen1_OnUserControlButtonClicked(object sender, EventArgs e) { …
SamuraiJack
  • 5,131
  • 15
  • 89
  • 195
1
vote
1 answer

Enter a character in the active window of an external program

Note- This question is not a duplicate, because i'm asking how to send to the window that was/is active at the time the button is clicked. The answer that was linked to will find a window and make it active. That's different. In C#, using Winforms,…
barlop
  • 12,887
  • 8
  • 80
  • 109
0
votes
1 answer

How to create diffrent sessions(tabs) in one browser and duplicating tab using IInputSimulator

I am using ChromeDriver with Selenium in my WPF desktop(.net core) application and I want to open different tabs(Sessions) in 1 Chrome browser For that I am using IInputSimulator(virtual keyboard) with the shortcut Ctrl+Shift+x but it is not opening…
0
votes
1 answer

Failed InputSimulation - Windows including User Interface Privacy Isolation (UIPI) Error

Hey i have written a software in C# and run it on a windows server 2019. I trying to navigate with: inputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.TAB); in the Explorer. The Programm should run 1 year after the start. And it…
CErdtmann
  • 1
  • 3
0
votes
0 answers

JavaScript Simulate Keyboard Input

Trying to find a way to simulate a keyboard input as seen here (c#) but in javascript: [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string…
0
votes
0 answers

Simulate Mouse Hover over Any UI element for any windows application

For context, my mission is to simulate all mouse interactions/inputs for a specific window handle without having the mouse actually be over said window. I’ve gotten very far with SendMessageA() and sending over WM_LBUTTONDOWN/UP, and the R version…
Nonlin
  • 550
  • 1
  • 6
  • 18
0
votes
1 answer

WPF InputSimulator not working on a User Control

The goal is to make a User Control Keyboard so I installed InputSimulator from NuGet, I tried it with a button and it's working well of course after setting the property Focusable of that button to False, but when I created a keyboard as a…
Clay
  • 213
  • 1
  • 2
  • 9
1
2