simulate

How to simulate multimedia key press (in C)?

十年热恋 提交于 2019-11-28 05:01:05
问题 Modern keyboards have special multimedia keys, e.g. 'Pause/Play' or 'Open Web Browser'. Is it possible to write a program that "presses" these keys? I would prefer solution in C, but I would accept a language agnostic solution, too. 回答1: Use the SendInput Windows API, if you are talking about programming under Win32. You need to build INPUT structures, setting the type member to INPUT_KEYBOARD. In the ki member (KEYBDINPUT type), you can set vk (virtual key) to your desired VK code (for

Jquery script for simulated key press down not running keyboard shortcut

回眸只為那壹抹淺笑 提交于 2019-11-28 02:17:52
Id like to give thanks in advance for any time and effort spent on this. Ok so I have a script thats supposed to simulate a key press down event after 3 seconds once the page is loaded. I inteded for this keypress to run a keyboard shortcut but all it does it just press the key. How can i get it to actually run the shortcut once pressed? Not sure if this is even possible. Again thanks. <script> setTimeout( function(){ // jQuery plugin. Called on a jQuery object, not directly. jQuery.fn.simulateKeyPress = function(character) { // Internally calls jQuery.event.trigger // with arguments (Event,

Play audio as microphone input

ⅰ亾dé卋堺 提交于 2019-11-27 18:21:29
I am to test voice recognition programs. Some which I have access to the code and others where I don't. Sadly my (beautiful) voice is not perfect, so when I am reading a text it sounds slightly different each time. Which makes the testing difficult and time consuming. Giving that I can tweak a lot of parameters. So I was wondering if there was a way to record my own voice (already done). And then play it as normal microphone input so the voice recognition program I am testing will see it as microphone input. This would also help greatly if it could be done programatically in C#. So I can in my

Simulate click at x/y coordinates using javascript

穿精又带淫゛_ 提交于 2019-11-27 17:03:05
问题 How can I simulate a click at x/y co-ordinates using javascript or jquery? I will use the script multiple times and I want the script to click on postion one then postion two then three then four and so one. It is better without moving the mouse cursor, but if it has to move then that is fine as well. 回答1: This can actually be accomplished with the document.elementFromPoint method. A jQuery example: function simulateClick(x, y) { jQuery(document.elementFromPoint(x, y)).click(); }

Simulate pressing tab key with jQuery

我怕爱的太早我们不能终老 提交于 2019-11-27 15:35:52
问题 I have some textboxes on a .net-page and want to achieve the following with jQuery: if the user presses return, the program should behave "as if" he had used the tab key, thus, selecting the next element. I tried the following code (and some more): <script type="text/javascript"> jQuery(document).ready(function () { $('.tb').keypress(function (e) { if (e.keyCode == 13) { $(this).trigger("keydown", [9]); alert("return pressed"); } }); }); <asp:TextBox ID="TextBox1" runat="server" CssClass="tb"

Jquery script for simulated key press down not running keyboard shortcut

时光毁灭记忆、已成空白 提交于 2019-11-27 04:54:54
问题 Id like to give thanks in advance for any time and effort spent on this. Ok so I have a script thats supposed to simulate a key press down event after 3 seconds once the page is loaded. I inteded for this keypress to run a keyboard shortcut but all it does it just press the key. How can i get it to actually run the shortcut once pressed? Not sure if this is even possible. Again thanks. <script> setTimeout( function(){ // jQuery plugin. Called on a jQuery object, not directly. jQuery.fn

Simulate click into a hidden window

六眼飞鱼酱① 提交于 2019-11-27 03:40:40
问题 I've got a C# problem, I am able to simulate a click to the current window, but I would like to do it if the window is minimized or hidden. Any ideas? 回答1: Here is a fully working snippet which will give you the window handle, target sub window and post a message to that subwindow. #include "TCHAR.h" #include "Windows.h" int _tmain(int argc, _TCHAR* argv[]) { HWND hwndWindowTarget; HWND hwndWindowNotepad = FindWindow(NULL, L"Untitled - Notepad"); if (hwndWindowNotepad) { // Find the target

Play audio as microphone input

别来无恙 提交于 2019-11-26 19:23:41
问题 I am to test voice recognition programs. Some which I have access to the code and others where I don't. Sadly my (beautiful) voice is not perfect, so when I am reading a text it sounds slightly different each time. Which makes the testing difficult and time consuming. Giving that I can tweak a lot of parameters. So I was wondering if there was a way to record my own voice (already done). And then play it as normal microphone input so the voice recognition program I am testing will see it as

Simulate Python keypresses for controlling a game

坚强是说给别人听的谎言 提交于 2019-11-26 18:39:32
I'm trying to control a game (my two test games are Half Life 2 and Minecraft) using my Kinect and Python. Everything works except for one thing. The game will respond to simulated mouse events and simulated mouse movement (mouse events are done via ctypes and mouse movement is done using pywin32). The problem however is that the games ignore simulated keypresses. Both of them will pick up the simulated keypresses in either the chat window (Minecraft) or the developer console (Half Life 2) but not while playing the actual game. I've tried several ways of sending the keypresses: import win32com

How to simulate fisheye lens effect by openCV?

故事扮演 提交于 2019-11-26 17:33:26
I am looking for ways to create fisheye lens effect, looked at documentations for openCV, it looks like it contains Camera Calibration functions for radial distortions like fisheye. Is it possible to simulate fisheye distortion by openCV? If it is possible to do it by openCV, comparing to openGL, which one will generate better results? Thanks. I created this app using opencv. Is this the effect you are referring to? I basically coded the formula shown on wikipedia's "Distortion(optics)" I can show the code if needed Update : OK, so below is the actual code written in c++ using opencv (not