mouse

Moving Mouse in C# (coordinate units)

五迷三道 提交于 2021-02-07 08:28:46
问题 I'm trying to make Teamviewer like piece of software for fun, which allows one person to view another person's screen and click and all that. Anyway, I have most all of the socket stuff done, but I don't know how to get the mouse clicks to work correctly. Here is the code I found online for moving the mouse programmatically: public static class VirtualMouse { // import the necessary API function so .NET can // marshall parameters appropriately [DllImport("user32.dll")] static extern void

Sending keyboard events to another application in C# that does not handle Windows events

白昼怎懂夜的黑 提交于 2021-02-06 10:16:05
问题 here is my situation: we are writing an application that must transform Microsoft Kinect coordinates into keyboard and mouse events. When we need to take control of the mouse, everything works as we intended in ANY kind of application. The problem arises when we need to send keyboard events (like key down or key up) to applications that doesn't handle Windows events, like games, for example. We tried the SendKeys class of the .net framework, and it only works with Windows applications. When

Multiple mice on OS X

99封情书 提交于 2021-02-05 20:05:29
问题 I am developing an OS X application that is supposed to take input from two mice. I want to read the motion of each mouse independently. What would be the best way to do this? If that is not possible, is there a way to disable/enable either of the mice programmatically? 回答1: The HID Class Device Interface is definitely what you need. There are basically two steps: First you need to find the mouse devices. To do this you need to construct a matching dictionary and then search the IO Registry

Multiple mice on OS X

一个人想着一个人 提交于 2021-02-05 20:05:19
问题 I am developing an OS X application that is supposed to take input from two mice. I want to read the motion of each mouse independently. What would be the best way to do this? If that is not possible, is there a way to disable/enable either of the mice programmatically? 回答1: The HID Class Device Interface is definitely what you need. There are basically two steps: First you need to find the mouse devices. To do this you need to construct a matching dictionary and then search the IO Registry

How can I get the mouse position in a console program?

我的未来我决定 提交于 2021-02-05 09:43:25
问题 How can I get the mouse click position in C++ in a Windows console program? (A variable that returns the position of the mouse when clicked) I want to draw a menu with simple text commands, so when someone clicks, the game will register it and know the position. I know how to do everything I need to do except get the mouse position when clicked. 回答1: You'll need to use the *ConsoleInput family of methods (peek, read, etc). These operate on the console's input buffer, which includes keyboard

C# Click and drag or Mouse Wheel with PostMessage / SendMessage

China☆狼群 提交于 2021-02-05 09:42:40
问题 I am creating a CONSOLE application , I need to scroll a certain part of the window from positions (x = 350, y = 240) to (x = 350, y = 120) (vertical scroll), I tried different ways but I couldn't. I was also unable to use the WM_MOUSEWHEEL option. Follow the code I use for clicks that work perfectly, I just need to adapt it to click and drag or determine a Y point on the window and use the mouse scroll. Could you please help me? Sorry for bad English, I used a translator. public class Win32

get clicks through html canvas

寵の児 提交于 2021-02-04 14:26:48
问题 I'm seeing a lot of questions about how to get the html5 canvas element to receive mouse clicks, I'm using the canvas as an overlay and the mouse clicks aren't going through to the elements below. I'm loading an image into the canvas, and I thought that might be the problem but I've also tried it with an empty canvas and I get the same result. Here is an example: with the image: http://www.1luckypixel.com/paranormal/canvas_test.html the link goes to google but it's not registering. It's my

Logitech Lua Sleep Behavior

▼魔方 西西 提交于 2021-01-29 17:14:39
问题 Since Egor always help, this is intended to show him the problem, but if you know how to solve, please help too! https://youtu.be/J2vRfnUplio <<< this is how the script should work. (look at the descripition for more info) https://youtu.be/HH_MmfXUdl8 <<< This is how it doing now, at windows newer versions. Having problems with Sleep() func on MouseMoveRelative on LUA ^^ This is the last question that shows the problem and you helped me there GHUB has the same version on both, so isnt GHUB

Having problems with Sleep() func on MouseMoveRelative on LUA

主宰稳场 提交于 2021-01-29 07:13:04
问题 got a new drive and installed a fresh windows. Before on old OS, i could use "Sleep" to make "MoveMouseRelative" work like it was natural movement. i have created a function were i can move the mouse calling it with how many times i want it to "move" and with the milliseconds between each "move" Example:(works well) function _move(x, range, time, range2) for i = 1, x do MoveMouseRelative(range,range2) Sleep(time) end end n If i set "Sleep(1)" beteween each "MoveMouseRelative" it moves like it

What does “Mouse X” and “Mouse Y” return in Unity?

萝らか妹 提交于 2021-01-28 09:32:43
问题 I wrote the following update: void Update () { if( Input.GetMouseButton(0) ) { if( !dragging ) { dragging = true; xDragStart = Input.GetAxis("Mouse X"); yDragStart = Input.GetAxis("Mouse Y"); } xDrag = Input.GetAxis("Mouse X"); yDrag = Input.GetAxis("Mouse Y"); DragValuesText.text = "x = " + xDrag + ", y = " + yDrag; } else { if( dragging ) { dragging = false; } } } and made a Text UI to display DragValuesText . After this I found, that returned values are small while I am dragging and turn