mouse

Capture and send keyboard / mouse input in C#

旧城冷巷雨未停 提交于 2019-11-27 16:56:38
问题 I am looking for a way to send and receive keyboard information regardless of what app has focus. I remember back in College seeing a presentation about an old Windows API that let you change the cursor position and send right clicks and such. Besides User32.dll is there a way to do this with the .net framework? 回答1: AFAIK, there's no way to capture the GLOBAL keyboard & mouse events. But there are a few articles on CodeProject which demonstrate the creation of .NET class wrappers for the

Simulating mouse input programmatically in OS X

ε祈祈猫儿з 提交于 2019-11-27 16:51:31
Is it possible to simulate the actions of a mouse from a program in OS X? Specifically, the short version is that I'm trying to simulate a touchscreen using two webcams. So assuming I can get X,Y positions, can I send information to the OS as a mouse movement or click? Edit- Or if it's particularly easy in another operating system I'd be willing to consider that. Yes, it is possible. You can use the Quartz Event Services to simulate input events. Assuming C, I wrote this quick example: #include <ApplicationServices/ApplicationServices.h> #include <unistd.h> int main() { // Move to 200x200

Programmatically click and move mouse with VB.NET

混江龙づ霸主 提交于 2019-11-27 16:48:10
问题 I want to build a program in VB .net that will allow me to control my pc with my laptop. The only question I really have is, how can I programmatically click without using some kind of click event, say if I want to click the start orb and my mouse is at that exact location, I'd like a sub or something that will click on it. Right now I only know how to click within the form. Thanks 回答1: You can set the Cursor position with the property Cursor.Position . You will need to P/Invoke mouse_event

Winform - determine if mouse has left user control

不羁岁月 提交于 2019-11-27 16:15:45
I am struggling with something that I think should be easily (ish). I have a windows form and a flowgridlayout panel at the bottom of the form. Inside this form I dynamically populate it with X number of User Controls. The controls are all the same type. The goal is when the user hoovers the mouse over the user control it opens another form and positions it where the mouse is. When mouse leaves the form the opened form disappears. This almost works great. The problem is when the User Control has anything like a label or text box inside it. It is considered to have left the UC so the form

Move mouse cursor with node.js [closed]

此生再无相见时 提交于 2019-11-27 15:10:27
问题 Is there is any way or module to move cursor and simulate mouse clicks in windows7/8 with node.js? I found this library https://www.npmjs.org/package/win_mouse but seems like it doesn't work 回答1: I've been working on a module for this, RobotJS. Example code: var robot = require("robotjs"); //Get the mouse position, retuns an object with x and y. var mouse=robot.getMousePos(); console.log("Mouse is at x:" + mouse.x + " y:" + mouse.y); //Move the mouse down by 100 pixels. robot.moveMouse(mouse

Disabling mouse movement and clicks altogether in c# [duplicate]

心不动则不痛 提交于 2019-11-27 15:01:59
问题 This question is an exact duplicate of: Block/Nullify mouse movement/click in C# 1 answer At work, i'm a trainer. I'm setting up lessons to teach people how to "do stuff" without a mouse... Ever seen people click "login" textbox, type, take the mouse, click "password", type their password, then take the mouse again to click the "connect" button beneath ? So i'll teach them how to do all that without a mouse (among many other things, of course) At the end of the course, i'll make them pass a

Mouse position - Cross browser compatibility - Javascript

一笑奈何 提交于 2019-11-27 14:58:38
问题 working with the mouse within Javascript I have occasionally met the following event attributes: clientX, clientY layerX, layerY offsetX, offsetY pageX, pageY screenX, screenY x, y I'm wondering what their cross-browser compatibility looks like in general, as I have only found bits and pieces of info that I'm trying to patch up together. Thanks guys 回答1: Here is how jQuery does it : // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) {

Injecting Mouse Input in WPF Applications

做~自己de王妃 提交于 2019-11-27 14:10:40
问题 I've been working on injecting input into a WPF application. What makes this project hard is that I need to be able to inject the input into the application even though it's running in the background (i.e. another application has the input focus). Using the SendInput() function is therefore out of the question. So far, I've got keyboard input working but am having trouble injecting mouse input. I used Spy++ to observe the window messages that get sent to the WPF window when I physically click

How do I edit Visual Studio's mouse shortcuts?

和自甴很熟 提交于 2019-11-27 13:52:55
Visual Studio used to execute the "Naviagte Backward" command whenever I hit the back thumb button on my mouse, but it has recently stopped doing that. How can I edit Visual Studio's mouse shortcut settings to re-enable this feature? Edit: Starting a bounty, still haven't gotten a concrete answer about this. Pedro77 From my topic . Plugin that attaches Navigate back/forward to the mouse buttons: Mouse Navigation The last version (2.2.0) is working fine. Some clarifying: Visual Studio (2012) separates the normal navigation from "click to go" navigation. Normal navigation: mouse click anywhere

Simulating mouse clicks on Mac OS X does not work for some applications

空扰寡人 提交于 2019-11-27 12:56:56
I'm writing an application for Mac OS X 10.6 and later in C++. One part of the application needs to simulate mouse movement and mouse clicks. I do this currently by posting CGEvent objects using CGEventPost(kCGHIDEventTap, event); . This works, for the most part - I can simulate mouse movement and clicks just fine, but it seems to fail in some areas. For example: In Mozilla Firefox and Safari, I can click on all the menus, but cannot click on a link within a website. When I try, the link is highlighted, but the browser never follows the link. However, I can right-click on a link, select "open