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
4
votes
2 answers

How do you send NumPad keys using SendKeys?

I want to send the keystroke of NumPad keys (1-9). I tried to use: SendKeys.SendWait("{NUMPAD1}"); but it says System.ArgumentException: The keyword NUMPAD1 is invalid (translated) So i don't know the right keycode for the NumPad.
Regster Up
  • 113
  • 1
  • 2
  • 7
4
votes
1 answer

Sending key "hangs" PC in C#

My PC hangs when I send key in Form_Shown() and placing Breakpoint at Form_KeyDown() private void Form1_KeyDown(object sender, KeyEventArgs e) { //breakpoint here if (e.KeyCode == Keys.A) { …
Javed Akram
  • 15,024
  • 26
  • 81
  • 118
4
votes
2 answers

SendKeys to a specific program without it being in focus

I am trying to use sendkeys, but send it to a non focused program. For example, I want to use sendkeys to Notepad - Untitled, without it being focused. Sorry if it's unclear, I will elaborate. My current code is this: string txt =…
Omney Pixel
  • 47
  • 1
  • 2
  • 5
4
votes
2 answers

SendKeys to a windows file dialog

I want to send the string ABC to the input field of a windows file dialog. With this code line I can set the focus to the correct element. I see a blinken cursor. var filedialogOverlay = drv.SwitchTo().ActiveElement(); But the following code…
kame
  • 20,848
  • 33
  • 104
  • 159
4
votes
0 answers

Protractor key-down and send keys to zoom browser

I'm attempting to zoom in/out a page using protractor...I've tried the following two methods (I've included both in a helper but no success with either - the current/non-commented out one opens duplicate tabs): helpers.zoom_page_out = function…
4
votes
2 answers

Is there any way to copy a text from another program without Select it?

I want to copy text from other program, in this program Ctrl+a is considered for other command, and I can't use " SendKeys.SendWait("^a");" to select the text. Is there any way to copy that text?
Deve loper
  • 103
  • 8
4
votes
1 answer

How to set value of text field all at once with a webdriver?

I am using Cucumber, watir-webdriver, page-object, and jruby. I am writing a method in a page class that enters a value into a text area. I am using a generated method in the page-object gem that, under the hood, invokes the Watir-Webdriver set…
Dmitry Sharkov
  • 541
  • 7
  • 19
4
votes
3 answers

.NET sendkeys to calculator

The sendkeys code below works well for Notepad but it doesn't work for Calculator. What is the problem? (It's another problem compared to what I sent here Sendkeys problem from .NET program) [DllImport("user32.dll", CharSet =…
user397232
  • 1,750
  • 6
  • 21
  • 30
4
votes
2 answers

WebDriver - sendKeys(input) does not complete before sendKeys(Keys.RETURN)

My test is entering keys in an search text box, that's mostly ajax, and then pressing enter from the keyboard. There is no button to "start" the search so we're using the Enter key. I'm using ChromeDriver as Firefox is not supported for our…
catp
  • 41
  • 1
  • 3
4
votes
1 answer

System.Windows.Forms.Keys as the argument for SendKeys.Send

I need to send System.Windows.Forms.Keys enum with the method SendKeys.Send(string keys). How do I convert Keys enum to string compatible with this method? I can do switch and try if the key is one of incompatible keys, like this: string toSend =…
Sorashi
  • 931
  • 2
  • 9
  • 32
4
votes
2 answers

WScript Sendkey doesn't accept Unicode Characters

I am trying to send char "ä" using WScript Sendkeys.Seems its not working . I found one post Does or Can VBscript's SendKeys support Unicode? My Code: Set sh = WScript.CreateObject("WScript.Shell") sh.Run "notepad.exe", 9 WScript.Sleep 1000 'wait a…
workspace
  • 368
  • 1
  • 6
  • 16
4
votes
1 answer

Double key typing by SendKeys

I am having a weird problem with SendKeys.Send Basically what happens is this. I have Internet Explorer in focus at google.com and I call SendKeys.Send("TestSample\n"); it sometimes sends some keys twice (like TeestSample or TestSSSample) in an…
JessicaB
  • 159
  • 1
  • 1
  • 4
4
votes
1 answer

SendKeys on selenium webdriver once in a while sends text in upper case in Internet Explorer 10

SendKeys on selenium webdriver once in a while sends text in upper case in Internet Explorer 10 - for example a login page: var wait = WebDriverWaitObject(); wait.Until(d => this.driver.FindElement(By.Id("uid"))); …
sam0673
  • 171
  • 1
  • 3
  • 11
4
votes
1 answer

Emulate Fn key press using keybd_event API or sendkeys class

I have a Fn key on my USB keyboard which allows me to enable certain features on my keyboard. So, if I press Fn + F10, the keyboard will switch to a different mode. I have a feeling it's possible that Windows has no access to the Fn on my keyboard.…
MKANET
  • 573
  • 6
  • 27
  • 51
4
votes
1 answer

Alternative to SendKeys that does NOT require an unlocked session

Situation: A GUI app contains functionality (off a menu option) that produces a frequently updated image to a directory. A logged-in, running instance of the app is the ONLY source for this image (functionality 'reliant' on display device). I have…
Chris
  • 149
  • 6