Synthesizes keystrokes, mouse motions, and button clicks.
Questions tagged [sendinput]
251 questions
2
votes
1 answer
Sending a Keyboard Input with Java JNA and SendInput()
I'm interested in interacting with the OS with java in this case windows 7 and want to emulate some keystrokes (e.g. CTRL + V) on a low level.
First of all i know java is a bad choice but its my best programming language and i know its…

Ext1nct1on
- 21
- 1
- 2
2
votes
1 answer
Unable to Simulate Alt-Tab Virtual Key Press, works fine with other keys
I have a simple code
KEYBDINPUT k1 = { VK_MENU, 0, 0, 0, 0 };
KEYBDINPUT k2 = { VK_TAB, 0, 0, 0, 0 };
KEYBDINPUT k3 = { VK_TAB, 0, KEYEVENTF_KEYUP, 0, 0 };
KEYBDINPUT k4 = { VK_MENU, 0, KEYEVENTF_KEYUP, 0, 0 };
int cnt = 0;
while (cnt < 10)
{
…

Adorn
- 1,403
- 1
- 23
- 46
2
votes
2 answers
How to simulate mouse click using C++?
I need to simulate a mouse click that clicks on application windows. I'm using Windows.
How can I send a left button mouse click to screen x, y coordinates where the window is located?

Ufx
- 2,595
- 12
- 44
- 83
2
votes
2 answers
Can't get SendInput() to work
I'm kind of desperate. I have been trying for hours now, but I just can't get SendInput() to work. To be honest, I can't even get it to be recognized. It always says:
Error 1 The type or namespace name 'INPUT' could not be found (are you missing…

Zampano
- 35
- 5
2
votes
1 answer
C# SendInput Alt/Ctrl/Shift Keys not getting Released
I am using the below code to pass special keys using SendInput. I am facing one strange issue. If user sends any of Alt/Ctrl/Shift, the key remains pressed e.g. if user passes Alt + F4, the code runs properly and action is completed successfully but…

Parveen Kumar
- 419
- 3
- 7
- 20
2
votes
1 answer
Send Special Keys Over Remote Desktop
I am able to send special keys on local machine but the same thing is not working on remote machine. I referred to many articles but could not find the code to send special keys to remote desktop connection. Please help on this. Below is the code.
…

Parveen Kumar
- 419
- 3
- 7
- 20
2
votes
2 answers
Sendkey Function Enter Key Issue
So here is my problem , I've been trying to simulate various key events with the sendinput() function, I even wrote functions to simulate complex key events like winkey+D, alt+f4 etc using that function , anyway
everything worked fine till I…

George mits
- 51
- 6
2
votes
1 answer
Mouse pointer freezes after calling Sendinput, on minimize/maximize/close window buttons
I am building an application that receives mouse move/press/release commands from another computer and simulates them using the windows Sendinput function.
Everything works fine except the case where I click on the minimize or maximize or close…

Yiannis Mpourkelis
- 1,366
- 1
- 15
- 34
2
votes
1 answer
SendInput not working in certain apps - Windows with Delphi
Using Delphi, I'm trying to find a way of sending a string/series of characters or keystrokes to the active window. Using SendInput I have the following code:
uses
System.SysUtils, Windows, System.Types, System.UITypes, System.Classes,
…

Bruce Button
- 55
- 6
2
votes
1 answer
Can't convert from virtual key code to unicode
I need to inject text into directinput applications. I'm using SendInput, but using virtual key codes doesn't work with directinput, so I need to use Unicode. Now, the keys I wan't to inject are registered on a file as virtual key codes, and i need…

Alex
- 45
- 1
- 7
2
votes
0 answers
How do you track inputs that were sent from SendInput in C++
I have two separate programs running at one time.
One of the programs is a virtual keyboard that causes keyboard presses when you click that respective letter on the GUI. It uses SendInput() to make the keyboard commands and is coded in C#.
The…

user3716704
- 23
- 2
2
votes
1 answer
Simulating number-sign (#) keystroke in C#
I'm trying to accurately type a hash sign (number sign, pound sign, octothorpe, whatever you call it) using SendInput in user32.dll.
These are the possible options I see:
Type the number-sign by simulating SHIFT+3 (SHFT_DN, 3_DN, 3_UP, SHFT_UP). My…

Adam Plocher
- 13,994
- 6
- 46
- 79
2
votes
3 answers
Way to turn on keyboard's caps-lock light without actually turning on caps-lock
I'm writing a program that uses Caps Lock as a toggle switch. It would be nice to set the LED of the key to show that my program is on or off, like the Caps Lock key does naturally.
I know that I could just SendInput('Capslock'); or whatever to…

ck_
- 3,719
- 10
- 49
- 76
2
votes
0 answers
SendInput for Non Unicode, Non Ascii characters
I am writing a Global Hook Procedure. Using SendInput to send ascii ( < 255 ) and Unicode characters. So far it is working well.
But in my language, Tamil there are some characters that are combination characters which do not have Unicode code…

sridharxp
- 21
- 2
2
votes
1 answer
Can the sendinput API simulate a keyboard key being held down during some time?
My app will need to simulate a key being held down during some time. I don't know how many time. Can I use the sendinput API for this?

Aaron de Windt
- 16,794
- 13
- 47
- 62