Library to send mouse and key Inputs
I have a project where i need to send Mouse and Key Inputs on a Global level from my WindowsForms application.
I need somethig like https://www.nuget.org/packages/H.InputSimulator#readme-tab, the only problem ive got with this library is that once i send the key i cant get it to be held down, a crucial point of the project is that i need to simulate the held down key for a small amount of time (for example if i hold the key down for 2 seconds i get: lllllllllllllllllllllllllllllll). Does anyone know a library that is able to do that or know a way to do that with the given library?
H.InputSimulator 1.4.1
Allows you to simulate global mouse and keyboard events.
Features:
- Supports scan codes and multi-language input.
- Supports WPF/WinForms/Console windows apps.
- Supports .NET Standard, .Net Core and .Net 5/6.
Supported OS:
- Windows
6 Replies
What are you trying to make?
A programm that can record mouse and keybord strokes and replay them, i call it a macro recorder, i have the recording part done now i need to do the play part
I used this library: https://github.com/michaelnoonan/inputsimulator
GitHub
GitHub - michaelnoonan/inputsimulator: Windows Input Simulator (C# ...
Windows Input Simulator (C# SendInput Wrapper - Simulate Keyboard and Mouse) - GitHub - michaelnoonan/inputsimulator: Windows Input Simulator (C# SendInput Wrapper - Simulate Keyboard and Mouse)
thanks this might be just what i need.
i cant get the key to be held down, do you know what i have done wrong?
hey i still couldnt figure out how to hold the key down, do you have an idea?
Try to use async method and call KeyDown then await Task.Delay(2000) and then KeyUp
i tried doing it like this but this also doesnt work
i just noticed that whenn i try it in a game for example minecraft the key actually gets held down so i can walk, but when i try it in a text Programm it only gets a single input