M
M
MacReady2016-07-23 23:02:32
C++ / C#
MacReady, 2016-07-23 23:02:32

How to simulate alt codes in C#?

Good evening, problem.
C# + has a linked library (InputSimulator or Global Mouse and Keyboard Library).
I need to simulate pressing ALT+Numpad codes (alt codes), but when I run

KeyboardSimulator.KeyDown(Keys.Alt);
KeyboardSimulator.KeyPress(Keys.NumPad1);
KeyboardSimulator.KeyUp(Keys.Alt);

nothing happens, only the warning sound of Windows is heard (the keyboard hijacker says that all presses pass, everything is fine).
When I run for example
KeyboardSimulator.KeyDown(Keys.Alt);
KeyboardSimulator.KeyPress(Keys.Tab);
KeyboardSimulator.KeyUp(Keys.Alt);

all is well, it works. The only problem is with the numpad.
What could be the solution?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question