Questions tagged [sendkeys]

A .NET class that sends one or more keystrokes to the active window as if they were typed at the keyboard.

A .NET class that sends one or more keystrokes to the active window as if they were typed at the keyboard.

MSDN Documentation for System.Windows.Forms.SendKeys

1218 questions
5
votes
1 answer

VB Simulate a key press

In my program, I want to simulate the pressing of the MediaPlayPause key. Just as a note, I do not want to check to see if the key is down or pressed, I want to press the key via my program. I have tried SendKeys.Send but the special keys are…
jgetrost
  • 193
  • 4
  • 12
5
votes
1 answer

Automated Send Keys Failing When No RDP

I have a VM that I wish to run an automated task on (i.e. the automated task runs on the actual VM). The VM is a Windows 2008 server. I have added the task into the task scheduler, and when I'm logged into the machine via RDP I can run the task by…
David Johnson
  • 399
  • 2
  • 4
  • 15
5
votes
2 answers

How to control SendKeys.Send{"tab"} property in Datagridview?

I am writing the code in datagridview cell enter event as private void dgvGoodsRecpt_CellEnter(object sender, DataGridViewCellEventArgs e) { if (dgvGoodsRecpt.CurrentRow.Cells[e.ColumnIndex].ReadOnly) { SendKeys.Send("{tab}"); …
Learner
  • 1,286
  • 6
  • 34
  • 57
5
votes
2 answers

How can I send keyboard commands (hold,release,simultanous) with a python script?

I want to send virtually the command like this: when keypress=="a" #if entered key is "a" send {ALT+TAB} # send ALT and TAB simultaneously sleep(2) #wait for 2 sec send {"I love…
arifcse10
  • 133
  • 2
  • 3
  • 12
5
votes
2 answers

How to send a keystroke to an other process (ex a notepad)?

I got a notepad which has a PID: 2860 #include #include #include using namespace std; HWND SendIt (DWORD dwProcessID){ HWND hwnd = NULL; do { hwnd = FindWindowEx(NULL, hwnd, NULL, NULL); …
SmRndGuy
  • 1,719
  • 5
  • 30
  • 49
5
votes
1 answer

SendKeys.SendWait does not send "{ENTER}" in Windows 7

I have tried this in Visual Studio 2008 with XP and Windows 7: SendKeys.SendWait("sometext{ENTER}{ENTER}") This is for opening a file in an open file dialog box. It works on XP with VS2008, but when I try on Windows 7, it seems that the {ENTER} keys…
jpints14
  • 1,361
  • 6
  • 15
  • 24
5
votes
9 answers

C# SendKeys.Send

I am running on an issue using C# SendKeys.Send method. I am trying to replace keyboard keys with other keys, for example when I press "a" in keyboard I want that key to be "s" for example, when I am doing this in my code: if ((Keys)keyCode==…
milot
  • 1,060
  • 2
  • 8
  • 17
4
votes
4 answers

SendKeys.SendWait method in C#, emulating CTRL+C

I'm trying to hold down CTRL while C is pressed but I can't get it work. I've read SendKeys Class but still, it doesn't work. Thats what I've…
Patryk
  • 3,042
  • 11
  • 41
  • 83
4
votes
1 answer

How to send "{" or "}" signs through send keys method in vb 2010

I want to send { and } signs to the Active window in Visual Basic 2010.But the problem is when we send a key like "Backspace" we send it as "{BS}".So it also contains the { & } signs. Therefore when we send { and } signs nothing happen.Anyone help…
Thusitha
  • 3,393
  • 3
  • 21
  • 33
4
votes
4 answers

How to send keyboard scan codes manually?

I'm working on a project that needs to emulate a keypress of the Windows key. I've tried SendKeys.Send to no avail. Specifically, the windows key needs to come in concert with a button. That is, I want to send Windows Key and plus / minus.
tsilb
  • 7,977
  • 13
  • 71
  • 98
4
votes
1 answer

SendKeys with games: with some characters it works, but with some it doesn't

I want to simulate input in games with SendKeys, but I have a hard time. If I use it with i.e. the letter T, while the cursor in Minecraft is in a textbox (in the main menu), it works, the letter T is written in the textbox. But with {ESC} it…
Tudvari
  • 2,715
  • 2
  • 14
  • 33
4
votes
2 answers

Sendkeys("{BACKSPACE}") inserts "B" characters instead of backspacing

I have a TextBox declared in a Silverlight project with contents “123456” and then use the following code in a Coded UI test. First it searches and clicks the TextBox to set focus, and then tries to delete…
Aaron Axvig
  • 370
  • 1
  • 3
  • 9
4
votes
1 answer

VBA Replace Sendkeys to select option in print settings

When printing in Excel, my workplace has an additional pop up window for selecting print options. It is not part of Excel (I believe it is a canon printer dialogue window). These options allow you to specify to print in colour, staple and collate…
bawpie
  • 467
  • 4
  • 12
  • 27
4
votes
2 answers

C# Send key inputs to Minecraft to move the player

I am trying to send keyboard inputs to Minecraft to move the player, however when I try using SendKeys.SendWait("W"); nothing happens. If I open the chat in Minecraft it types "W" in chat, however outside of chat my inputs seem to be ignored.…
Jason A
  • 111
  • 1
  • 9
4
votes
4 answers

Moving Right One Cell

I'm trying to move one cell to the right in a macro. Range("C5").Select <-- a formula that needs to be copied Selection.Copy Range("B5").Select Selection.End(xlDown).Select SendKeys ("{TAB}") Range(Selection,…
Mark Spain
  • 83
  • 1
  • 2
  • 7