Aoki.Miku
Aoki.Miku

Reputation: 37

What is the virtual key code for the enter key on the main keyboard?

I want to write a program that repeatedly writes a predefined text inside of another program.

It works pretty good right now but I need to let my program press the enter key on the main keyboard. This msdn documentary delivers only the key code for the enter key on the numpad which is 0x0D.

But I have to use the main keyboard's enter key and can't find the representative key code.

Does anyone know the correct key code?

Thanks for any help.

Upvotes: 1

Views: 3606

Answers (2)

SJ10
SJ10

Reputation: 335

You can simulate pressing enter by using SendKeys.Send("{ENTER}"); which might not be the exact way you hoped to do it. If 0x0D isnt working, (see @Margus' answer), I encourage you to try this.

Upvotes: 1

Margus
Margus

Reputation: 20058

They are the same.

VK_RETURN 0x0D ENTER key

source: https://learn.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes

Upvotes: 0

Related Questions