sendkeys

Special keys on keyboards

北城余情 提交于 2019-12-21 02:56:14
问题 Is there a way for my program to be able to "fire" the special keys on my keyboard, such as the media keys (play, pause, next etc..). I'm trying to create an app that performs those functions and an easy way would be to simulate those keys being pressed. If it makes it easier, this is a personal project so I don't mind if the solution isn't generic and/or won't work for all keyboards. I've looked around and I think SendKey might be one way to go, but I don't know what the scan codes are for

How can I send keyboard input to a OpenGL/DirectX game window?

随声附和 提交于 2019-12-20 07:29:49
问题 How can I simulate a keypress in a game window (using any programming language in Windows)? AutoHotKeys Scripts and .NET SendKeys functions do not work... 回答1: Using AutoIt!3 (which is quite similar to AutoHotKeys), you'd use Send() (http://www.autoitscript.com/autoit3/docs/functions/Send.htm), but make sure to have the game window active ( WinActivate() ) before you do. I've used this to interact with Second Life (which uses OpenGL) succesfully. You may require a Sleep() period between

Sending keys to inactive application in C#/.NET [duplicate]

心已入冬 提交于 2019-12-20 03:22:46
问题 This question already has answers here : Simulating Key Press c# (7 answers) Closed last year . I have an application with combobox that contains names of currently running applications. As I understood from msdn library, SendKeys method can send keys only to active application. Is it somehow possible in .NET, to send keys also to inactive app? Or at least in WinAPI ? 回答1: You can use the SendMessage() API function to send keystrokes to an inactive window. 回答2: With C# <3 is everthing

How can I add a text in textarea form (in HTML tag) by selenium python?

落花浮王杯 提交于 2019-12-19 10:44:15
问题 I have this HTML code: <form class="_b6i0l"><textarea aria-label="Add a comment…" placeholder="Add a comment…" class="_bilrf" autocomplete="off" autocorrect="off" style="height: 18px;"></textarea> <textarea aria-label="Add a comment…" placeholder="Add a comment…" class="_bilrf" autocomplete="off" autocorrect="off" style="height: 18px;"></textarea> </form> I want write a text in the filed. But, this error is happened: selenium.common.exceptions.ElementNotInteractableException: Message: Element

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

落爺英雄遲暮 提交于 2019-12-18 10:08:55
问题 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 100. So I can't clear it or an error will be thrown before I can put in the new value using sendKeys, and if I sendKeys it just appends it to the value already there. Is there anything in WebDriver that lets you overwrite the value in the field? 回答1:

Trigger OS to copy (ctrl+c or Ctrl-x) programmatically

余生颓废 提交于 2019-12-18 04:21:14
问题 I'm working on a program to trigger cut and pastes Pastes I have no problem with (I just dump a string into the clipboard) Cut and or Copys are proving to be a little more difficult The program I have is out of focus and has several hot keys registered with the os CTRL + ALT + 2 CTRL + ALT + 3 etc) That I want to use to trigger Windows to copy anything that is highlighted in the window that is focused I tried doing a sendkeys SendKeys.Send("^c"); but that seems to work once or twice if at all

Simple Application for sending Keystroke in VB.NET

∥☆過路亽.° 提交于 2019-12-17 21:22:26
问题 I have an issue regarding Sendkeys Class, as i want to use this class in order to send some keystroke to the active application. As a first step i want to test the {Enter} keystroke, so in order to achieve that i made a simple application in vb.net 2010 Public Class Form1 Public Shared data As String Private Sub SendintText(command As String) Try SendKeys.SendWait(command) Catch e As Exception MsgBox(e.StackTrace) End Try End Sub Private Sub Button1_Click(sender As System.Object, e As System

Detecting Ctrl+V with RegisterHotKey but not intercepting it

痞子三分冷 提交于 2019-12-17 18:59:13
问题 I need to detect when a user presses Ctrl + V (regardless of window focus - my app will likely be minimised) but I must not stop the actual paste operation. I have tried a few things: (I am successfully binding to keystrokes with RegisterHotKey) I have: protected override void WndProc(ref Message m) { if (m.Msg == 0x312) hotKey(); base.WndProc(ref m); } and I've tried the following: void hotKey() { SendKeys.SendWait("^v"); //just puts 'v' instead of clipboard contents } and void hotKey() {

VBA interaction with internet explorer

吃可爱长大的小学妹 提交于 2019-12-17 16:04:38
问题 The macro I am building takes names from an Excel spreadsheet, opens Internet Explorer, and searches the online directory. After searching the directory, it pulls up a Java form with the manager's name in it. I am able to manually tab to the manager name, right click, copy shortcut, and then post it back on the spread sheet. However, I am having problems with consistent tabbing and copying the shortcut. Is there a simple way of bringing focus back onto the IE window? How do you copy a

VBA interaction with internet explorer

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 16:02:24
问题 The macro I am building takes names from an Excel spreadsheet, opens Internet Explorer, and searches the online directory. After searching the directory, it pulls up a Java form with the manager's name in it. I am able to manually tab to the manager name, right click, copy shortcut, and then post it back on the spread sheet. However, I am having problems with consistent tabbing and copying the shortcut. Is there a simple way of bringing focus back onto the IE window? How do you copy a