How to simulate keystrokes when the mouse is pressed in the old program. THE NOTE! The program may not know that the mouse is pressed.
I am experimenting with
IntPtr module = LoadLibrary("user32.dll");
_mouseHookHandle = (HookType.MouseLowLevel, _mouseDelegate, module, 0);
and check to return -1 from HookProc. But when I do this, it SendInputdoes not send my entry to the application. If I return the result from CallNextHookEx, it SendInputworks, but then the mouse click is sent to the outdated application.
Background
We have a program that is controlled by a special keyboard. When you press a key on the keyboard, it sends a sequence of ESC and letters. Then the program performs an operation based on placing the mouse over the screen.
I am developing an on-screen keyboard so that you can control the application without this special keyboard. The user selects a button on the keyboard screen with the mouse. Then the user moves the mouse over the object that he wants to send a commando, and then click again. But at the same time, a mouse click cannot be transferred to the program; the program performs another operation with a mouse click.
source
share