The {
and }
characters are special escape characters. I don't think 6
is an escape value. Have a look at http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send(v=vs.110).aspx for the known escapes. For example, SendKeys.SendWait("{Right}");
would send a right arrow key.
However,
Many games and emulators will be using low level keyboard hooks to read the keyboard state. It's quite rare to find games that use the Windows events model for keyboard reading. SendKeys
only sends to the Windows messaging system. You may need a more low-level way of sending events.
If the target app is using DirectInput, you might be able to use the SendInput
function from user32.dll
:
- Docs - http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646310%28v=vs.85%29.aspx
- Example - http://www.ownedcore.com/forums/mmo/warhammer-online/186390-sendinput-example-c.html
There is also the Interception library, but I've never used it myself: