Synthesizes keystrokes, mouse motions, and button clicks.
Questions tagged [sendinput]
251 questions
0
votes
2 answers
Do you know how to emulate holding down a keystroke for any period of time, then releasing it later?
I'm trying to emulate pushing the keyboard V key down while using BASS library to automate Voice Activation push to talk. I've got the BASS library working, just can't get the keyboard to simulate holding down a Key for any length of time!
Edit:
I…

Greg T
- 122
- 7
0
votes
1 answer
C# virtual key modifier keys fail using Send Input method
I am trying to send simple key sequences (ctrl-p, shift-p) to the foreground app (which happens to be the Visual Studio editor unit test buffer). No matter what I try, I cannot get my test key sequences of control-p or shift-p to work properly. The…

Kevin
- 1,548
- 2
- 19
- 34
0
votes
0 answers
Pressing movement keys to a program without focus? C#
Possible simulating in C# a long press of (Down\Right\Left\Up) keys to a program without focus in C#?
-SendInput does simulate those keys but require focus.
-PostMessge\SendMessage does simulate keys without focus but not movement keys and not long…

Naveh
- 81
- 9
0
votes
0 answers
Is there a way to simulate a mouse click in under 1 ms?
I am attempting to make a program which needs to be able to move the cursor to and click on pre-defined coordinates on the screen with minimal latency.
What I have done, is use pinvoke to access the functions SetCursorPos and mouse_event from…

Jonathon Quick
- 125
- 1
- 1
- 6
0
votes
0 answers
Using C to send keyboard events
So I am using Java and with that I can use Robot to do key presses. Now parts of the software we want to use keypresses for do not accept these (they do nothing) but the keyboard does work.
So the first thing I tried was using a C dll library which…

Ghotirey
- 103
- 2
- 9
0
votes
0 answers
How to use SendInput key_down and key_up events without blocking thread?
I'm sending keys to a game. It works well but that i use thread.sleep blocks thread so i couldn't send keys from actual keyboard spams along code runs…

user3565914
- 51
- 1
- 9
0
votes
0 answers
SendInput function on a virtual keyboard
I am relatively new to c++, and recently, I have been trying to get a simulated mouse click program to work on the on screen keyboard present in Windows 10. To do this, I tried to use SendInput, but it does not seem to do anything on the virtual…

Quacko
- 11
- 1
0
votes
0 answers
Using a string with the SendInput Function on Windows
I want to use a std::string for the SendInput() function.
After doing some research, I found that the VkKeyScanEx might help but the code needs additional logic for uppercase or special characters. In the latter case I realized that I can simulate a…

BullyWiiPlaza
- 17,329
- 10
- 113
- 185
0
votes
1 answer
How to Get Mouse Cursor Cordinates when left click is pressed and when left click is released in C++?
I am trying to create snipping tool for college project I am trying to work on: where user can take screenshot of area mouse covered and stretched while clicked.
For example : When left mouse is clicked : It gets cordinates x,y axis and when mouse…

Shreyal Rana
- 11
- 3
0
votes
1 answer
Struggling with SendInput()
I want to inject every possible combination of 4 digit numbers into a different program (eg notepad) by imitating the keyboard, but I cannot for the life of me figure out how to use the SendInput() function, or if there is a better…

Angus87
- 45
- 4
0
votes
2 answers
How to implement my while loop into a GUI to keep pressing a key in C/C++ using visual studios
I have code that works on CMD where i can type 1 or 2 to run a C script to either click infinitely, or press F infinitely. I am trying to make a GUI, but the code seems to be really funky and new to me, possibly because it is more C++ based. The…

papaya
- 1
- 1
0
votes
1 answer
Globally preventing mouse from entering screen area
What I would like to do is to create an impenetrable edge on my desktop to protect a "zone". What I am looking for is kind of like mouse trapping, but I dont want to be strictly confined to a rect as this will be used in multi-monitor setups where…

Wobbles
- 3,033
- 1
- 25
- 51
0
votes
1 answer
C# / Powershell send a combination of keys
I found this function that makes use of C# code to simulate key press via PowerShell.
I can simulate a WINDOWS keys like this :
[KBEmulator]::SendScanCode(0x5B)
However I want to send the combination WINDOWS+CTRL+SHIFT+B
Which, in terms of…

Rakha
- 1,874
- 3
- 26
- 60
0
votes
1 answer
How to make SendInput use fixed (en-US) layout regardless of what layouts the user have installed or uses?
I find it quite handy that I can use SendInput to mix text and controls into single string and send it to any application like
"\nHello\nWorld" would end up with sequence of
hit {Enter}
type "Hello"
hit {enter}
type "World"
In any chat application…

LPVOID
- 306
- 3
- 17
0
votes
1 answer
SendInput with unicode string not properly sent into UWP app on Windows 10
I have an app that used to send unicode string (not keystroke) thanks to the SendInput api on Windows XP and Windows 7. I tried it on Windows 10 and noticed that if the target app is UWP (like Edge, OneNote, etc...), the Unicode string is not always…

Edgard Baudry
- 1
- 3