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
6
votes
3 answers

Sending specific keys on the Numpad like +, -, / or Enter (simulating a keypress)

I am working on a project where it is necessary to simulate key-presses to cause specific behaviours in a different application. All is running well and fine, using the keybd_event function that is being imported (there might be better ways, but it…
Andreas Reiff
  • 7,961
  • 10
  • 50
  • 104
6
votes
1 answer

Background Key Press Listener

I've got a simple window form application that turns on capslock when I press space and turns it off if I press a letter. Problem is that I have to focus on the window for it to work (top-most doesn't work either, top-most doesn't focus it just…
Or Betzalel
  • 2,427
  • 11
  • 47
  • 70
6
votes
3 answers

python selenium send_keys wait

I have a question regarding the send_keys function. How can I make the test wait for the entire content of send_keys to be entered? I can not use time.sleep, so I tried: WebDriverWait(self.browser, 5).until( …
Tom1416
  • 85
  • 1
  • 2
  • 11
6
votes
6 answers

Using AppActivate and Sendkeys in VBA shell command

I want to switch back and forth between application with the shell command in VBA. I am using SendKeys to do stuff in process A then move to process B, then to process A then process B. It works fine for the first iteration. When I use AppActivate…
elbillaf
  • 1,952
  • 10
  • 37
  • 73
6
votes
1 answer

Use Python to send keystrokes to Gameboy emulator in Windows?

This question was asked 3 years ago and the guy ended up with unsatisfying results. See: https://www.reddit.com/r/learnpython/comments/22tke1/use_python_to_send_keystrokes_to_games_in_windows/ Also posted on this site (w/ less discussion): Use…
Rey
  • 69
  • 2
6
votes
3 answers

Sending keys to a game

So I'm stuck with a problem, I'm trying to send keys to a game and I have the game in the foreground with help of SetForegroundWindow and I'm using SendInputs API to send the keys to the game. If I focus on another application the keys are sent to…
Tweath
  • 124
  • 6
  • 24
6
votes
1 answer

How to send unicode keys with c++ (keybd_event)

My friend is learning Norwegian and i want to make a global hot key program which sends keys such as æ ø å My problem is that keybd_event function wont allow me to send those keys, i seem to be restricted to the virtual key codes is there another…
Kaije
  • 2,631
  • 6
  • 38
  • 40
6
votes
1 answer

Using JavascriptExecutor to sendKeys plus click on web element

I'm trying to open a link in a new tab, then switch to that tab, in a Firefox browser, using selenium in Java. It's my understanding that in order to do this, I need to use a send keys combination. In order to open the link in the same window, I've…
ch-pub
  • 1,664
  • 6
  • 29
  • 52
6
votes
2 answers

C# Wait for SendKeys to finish sending before executing next line of code?

I think the title explains what I am asking. I need the SendKeys to finish sending the keys before the DoMouseClick method or my entire program is useless. // Simulate the keyboard typing the value of 'i' SendKeys.SendWait(i.ToString()); //…
DooMLaZyPro
  • 93
  • 1
  • 7
6
votes
3 answers

Selenium - send keys - what element should I use

I'm trying to scroll at the bottom of the page. I was adviced, here on SO, to do this: from selenium.webdriver.common.keys import Keys element = driver.find_element_by_ ... element.send_keys(Keys.CONTROL , Keys.END) I can't figure out what element…
Milano
  • 18,048
  • 37
  • 153
  • 353
6
votes
1 answer

Excel VBA: SendKeys fails on some computers

I'm working on an excel sheet wherein each row needs to indicate the last time that any cell within that row has changed. The simplest method I've found to do this is to put some tiny amount of VBA in the worksheet code, like so: Private Sub…
Adam Hoffman
  • 109
  • 1
  • 14
6
votes
4 answers

VBScript SendKeys CTRL+LWIN+TAB?

I am trying to write a simple script that will send the key combo of CTRL+WINDOWS KEY+TAB. The code below sends the keys CTRL+ALT+TAB Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.SendKeys "^%{TAB}" However when I try to replace…
daniel11
  • 2,027
  • 10
  • 38
  • 46
5
votes
3 answers

How to translate KeyCode to work at Keys.SendKey

is there a way to Translate a KeyCode in that way ,which will work if i use it at Keys.Sendkey(); private void Manager_KeyDown(object sender, KeyEventArgs e) { Keys.SendKey(e.KeyCode.toString()); } i tried that way and it wont work ,so is…
Rosmarine Popcorn
  • 10,761
  • 11
  • 59
  • 89
5
votes
1 answer

Selenium WebElement value empty after sending keys

I'm running some simple form tests where values are added fields. After each value is added to a field: input.SendKeys(value); I want to check the value in the field is correct. This may sound unusual but the field may have an ajax search attached…
Phil Cooper
  • 3,083
  • 39
  • 63
5
votes
5 answers

how to perform a hold ALT+TAB sendkey event in C#

I am trying to use a sendkey event that holds the ALT key and then presses the TAB key. How do you perform that action, I've tried many variations but I can't seem to find the answer, thanks.
mendez
  • 317
  • 3
  • 7
  • 14