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
85
votes
12 answers

Selenium WebDriver: I want to overwrite value in field instead of appending to it with sendKeys using Java

In WebDriver, if I use sendKeys it will append my string to the value that already exists in the field. I can't clear it by using clear() method because the second I do that, the webpage will throw an error saying that it has to be between 10 and…
True_Blue
  • 1,387
  • 2
  • 10
  • 13
41
votes
5 answers

Sending Windows key using SendKeys

I am working on shortcuts in C#. I succeed implementing Ctrl, Alt and Shift with SendKeys. Like this; Ctrl + C: System.Windows.Forms.SendKeys.SendWait("^c"); or Alt + F4: System.Windows.Forms.SendKeys.SendWait("%{F4}"); But I can't send "Windows…
nuriaycan
  • 413
  • 1
  • 4
  • 5
39
votes
3 answers

How do I send key strokes to a window without having to activate it using Windows API?

    I have made an application already that sends commands to an activated window. I want to be able to use the computer while my process is running because as soon as I switch focus to another window the key strokes being sent via send keys will go…
SlipToFall
  • 415
  • 1
  • 4
  • 8
38
votes
3 answers

How to send a key to another application

I want to send a specific key (e.g. k) to another program named notepad, and below is the code that I used: private void SendKey() { [DllImport ("User32.dll")] static extern int SetForegroundWindow(IntPtr point); var p =…
User2012384
  • 4,769
  • 16
  • 70
  • 106
37
votes
3 answers

Send keys through SendInput in user32.dll

I am using this board as a keyboard for demo purposes. Anyways to make the long story short everything works fine except for very few cases. I send keystrokes with the SendInput function located in user32.dll. So my program looks like: static void…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
27
votes
4 answers

Can I do SendKeys in Javascript?

SendKeys is method to sending keystroke to an application. Can I do it in Javascript, to send keystroke in browser ? REF : http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
diewland
  • 1,865
  • 5
  • 30
  • 41
24
votes
5 answers

SendKeys Ctrl-A not working

I'm trying to send CTRL A (select all to an app in this case word but try as I might it doesn't work) I've tried quite a few combinations but all to no avail, any ideas? IntPtr appHandle = FindWindow(null, "Document1 - Microsoft Word"); …
ALI
  • 241
  • 1
  • 2
  • 3
24
votes
12 answers

SendKeys is messing with my NumLock key via VBA code in Access form

I have the following code for an Access form. It appears as if the SendKeys is messing with my NumLock key by toggling it on and off as I open and close the form. For perfectly valid reasons which I don't want to get into, I really do not want to…
user12059
  • 733
  • 2
  • 13
  • 27
24
votes
2 answers

Send some keys to inactive window with python

I'm trying to send some keys to an inactive window/process/program (Win32/64) using Python. Already read about pywinauto and SendKeys, but both of them activate the window before sending keys. Is there any way to work with an inactive window without…
killradio
  • 241
  • 1
  • 2
  • 3
24
votes
4 answers

Alternative to SendKeys when running over Remote Desktop?

I have an application which injects keystrokes into applications via SendKeys. Unfortunately, the application will not work when I am running it via Remote Desktop because of the well known issue that SendKeys doesn't work with Remote Desktop. Has…
Cameron
  • 2,903
  • 1
  • 30
  • 31
20
votes
5 answers

Is there a sendKey for Mac in Python?

In Mac 10.6, I want to cause an active application to become de-active, or minimized by Python I know I could use sendKey in Windows with Python, then what about in Mac?
Yinan
  • 2,516
  • 4
  • 22
  • 23
18
votes
3 answers

How to slow down the speed of send_keys action in a selenium script using python?

I am currently creating a selenium script in python. I need to enter something in a text box using send_keys function. It is doing that correctly as of now. However, for an observation for I need to slow down the speed at which send_keys populates…
karan juneja
  • 387
  • 2
  • 4
  • 10
16
votes
3 answers

Cross-platform implementation of SendKeys in C#?

I need to automate desktop applications (not a web browser) testing on Windows, Mac and Linux. On Windows I use SendKeys, what do I use on Mac and Linux? Are there any cross-platform .NET Core SendKeys implementation that I can preferably use from…
IT Hit WebDAV
  • 5,652
  • 12
  • 61
  • 98
16
votes
1 answer

Python Selenium - AttributeError : WebElement object has no attribute sendKeys

I'm trying to pass through "ENTER" to a text field, using Selenium (Python). The text box requires that each phone number be entered on a new line, so it will look something like: #Add the phone number# Webelement.sendKeys(Keys.ENTER) I've imported…
ChrisG29
  • 1,501
  • 3
  • 25
  • 45
16
votes
4 answers

send "spacebar key" using SendKeys.sendwait()

I was wondering how to send spacebar key using SendKeys.send(); It works with the other keys but only the spacebar !! Here is the link where I found the other keys http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
seddik
  • 219
  • 2
  • 5
  • 12
1
2 3
81 82