Synthesizes keystrokes, mouse motions, and button clicks.
Questions tagged [sendinput]
251 questions
0
votes
3 answers
Cannot found any data type used by SendInput() function
I'm trying to use SendInput() function. I wrote this code:
#include
#include
#include
#include
#define WIN32_LEAN_AND_MEAN
//...
KEYBDINPUT kbi;
kbi.wVk = 0x31;
kbi.wScan = 0;
…

Jack
- 16,276
- 55
- 159
- 284
0
votes
1 answer
SendInput() misinterpreted in certain applications
My c# project sends an injected key combo to the foreground window. In notepad, Firefox, IE9 everything works as it should, but Adobe Illustrator CS5 seems to misinterpret the sent combos: for example CTRL+G becomes CTRL+SHIFT+WHEEL_DOWN so instead…

ZoltanE
- 173
- 1
- 7
0
votes
2 answers
SendInput sending mouse input AND keyboard input
=)
I am using C++ (not VC++) on windows7 laptop.
I have a problem with this method for moving the mouse x/y from it's current position. Every time it calls send input for a mouse event it moves the mouse but also turns off my screen (the equivalent…

Ollie
- 473
- 3
- 7
- 19
-1
votes
1 answer
Can you explain what each line of the C++ function is doing? It sends keystrokes but I am confused by how
I was making a program to send keystrokes to another window and I got it all working, but I had to go online and find a function to do the keystroke portion itself. It works but I have no idea what it is actually doing. Can someone comment each line…

user1125316
- 19
-1
votes
1 answer
Issues with SendInput()
I was hoping to get some help with this piece of code.
#include
#include
void keyPress(WORD keyCode)
{
INPUT input;
input.type = INPUT_KEYBOARD;
input.ki.wScan = keyCode;
input.ki.dwFlags =…

HereForBigHelp
- 3
- 4
-1
votes
2 answers
Simulating drag with SendInput C++
Does anyone know how to simulate mouse drag with SendInput in C++? I want to move the icon on the desktop programmatically. I expected the sequence (Move mouse to A)->(Press left button down)->(Move mouse to B)->(Release left button) would work, but…

YuriRzhanov
- 1
- 1
-1
votes
1 answer
Using SendInput or mouse_event doesn't work with clock()?
void leftClick(){
INPUT input[2];
input[0].type = INPUT_MOUSE;
input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
input[1].type = INPUT_MOUSE;
input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(2, input, sizeof(INPUT));
…

blank
- 54
- 5
-1
votes
2 answers
C++ SendInput()
I want to create a program which sends exactly one key stroke for every key stroke I press. I'm having a problem with this program because it keeps sending keystrokes even after I stopped pressing the key.
For example; if pressed "UP", it will…
-2
votes
1 answer
MouseHook+SendInput stopped working after fresh reinstall of Win7 x64
I coded a small KeyMapper some month ago which was used on my desktop-PC and Notebook (PC: Win7 x64, Notebook: Win8.1 x64). It was always working flawless untill i decided to reinstall Windows on my main PC (from Win7 64bit to (again) Win7 x64).
So…

Maric Slorat
- 67
- 2
- 12
-3
votes
1 answer
Mouse position values for SendInput
I am developing a C# application to simulate mouse movement using SendInput declared in Winuser.h.
My calls to SendInput work fine and I can move the mouse around the screen.
What I then tried was to record user mouse movement using:
…

Lance
- 411
- 2
- 6
- 18
-4
votes
1 answer
Simulate Keyboard Button Press for arrow keys
I've setup 2 functions to simulate keyboard button presses
void KeyboardButtonDown(DWORD a)
{
INPUT Input = { 0 };
// Set up a generic keyboard event.
Input.type = INPUT_KEYBOARD;
Input.ki.wVk = a;
SendInput(1, &Input,…

linjoehan
- 103
- 1
- 5