mouse

Java Robot class simulating human mouse movement

谁说胖子不能爱 提交于 2019-12-03 17:45:46
问题 I am working on a project about remote control, send conrdinate x and y of cursor from client to server. But robot.mouseMove(x,y); will only move the cursor to the particular point without moving the cursor form origional point I have find this simple algorthim to simulate the continuing movement of mouse for (int i=0; i<100; i++){ int x = ((end_x * i)/100) + (start_x*(100-i)/100); int y = ((end_y * i)/100) + (start_y*(100-i)/100); robot.mouseMove(x,y); } But this algorthim still too simple,

focus follows mouse (NO autoraise) in Mac Sierra

こ雲淡風輕ζ 提交于 2019-12-03 16:44:33
问题 I'm aware of the other threads on this topic but they are autoraised-based and/or all the answers point to software that's no longer being developed. I'm just looking for this simple feature: focus follows mouse WITHOUT autoraise for Mac. Zooom2 was able to perform this, but they are no longer developing their software. I'm not using the terminal and need to copy/paste and read between multiple programs with multiple windows, someone please tell you've found a solution to this? 回答1: chunkwm

How to read out scroll wheel info from /dev/input/mice?

∥☆過路亽.° 提交于 2019-12-03 15:29:34
For a home robotics project I need to read out the raw mouse movement information. I partially succeeded in this by using the python script from this SO-answer . It basically reads out /dev/input/mice and converts the hex-input into integers: import struct file = open( "/dev/input/mice", "rb" ) def getMouseEvent(): buf = file.read(3) button = ord( buf[0] ) bLeft = button & 0x1 bMiddle = ( button & 0x4 ) > 0 bRight = ( button & 0x2 ) > 0 x,y = struct.unpack( "bb", buf[1:] ) print ("L:%d, M: %d, R: %d, x: %d, y: %d\n" % (bLeft,bMiddle,bRight, x, y) ) while True: getMouseEvent() file.close() This

ShowCursor(FALSE) does not work

試著忘記壹切 提交于 2019-12-03 14:09:17
问题 I know this may sound to be a duplicate question but trust me it's not. I have referred this question, but was not of much help as I am trying with a console application and the answerer himself tells he does not know the reason why ShowCursor(FALSE) does not work for console applications. This thread did not help me either. Here are the things I tried: Using ShowCursor(): while(ShowCursor(false)>=0); //did not work I first suspected that it was because of this statement in the msdn : When

How do I use Rundll32 to swapmousebutton?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 13:34:27
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 8 years ago . I'm repeating a question from another forum, as I'd like the same answer. From MSDN's SwapMouseButton Function. How do I pass boolean data from command prompt through rundll32.exe to a boolean type argument in a command running from user32.dll? I'm trying to run this from CMD (the command prompt) RUNDLL32.EXE user32.dll,SwapMouseButton * Where the asterisk is here is where the

Simulate a physical mouse move in Mac OS X

半世苍凉 提交于 2019-12-03 12:51:11
I'm looking for a way to simulate a mouse move event in Mac OS X 10.6. It would have to be defined in mouse units (rather than pixels — that is important!) I need this for an experiment which basically consists of drawing lines. Any ideas are welcome. Thank you! One of the easiest ways to move the mouse in Mac OS X and other operating systems is to use a Java Robot . It can also simulate other events. For example, the mouse down or even a key press. However, it moves the pointer to a given screen coordinates. So the only thing you need to do is to convert your physical units into appropriate

Get the mouse coordinates when clicking on canvas

﹥>﹥吖頭↗ 提交于 2019-12-03 12:43:50
A common question, but I still need help. I'm trying to get and store the mouse coordinates when someone clicks within the canvas. my HTML <canvas id="puppyCanvas" width="500" height="500" style="border:2px solid black" onclick = "storeGuess(event)"></canvas> and my javascript //setup canvas var canvasSetup = document.getElementById("puppyCanvas"); var ctx = canvasSetup.getContext("2d"); guessX = 0;//stores user's click on canvas guessY = 0;//stores user's click on canvas function storeGuess(event){ var x = event.clientX - ctx.canvas.offsetLeft; var y = event.clientY - ctx.canvas.offsetTop; /

Simulate mouse movement in Ubuntu

跟風遠走 提交于 2019-12-03 09:24:44
问题 Problem Am looking to automatically move the mouse cursor and simulate mouse button clicks from the command-line using an external script. Am not looking to: Record mouse movement and playback (e.g., xnee, xmacro) Instantly move the mouse from one location to another (e.g., xdotool, Python's warp_pointer) Ideal Solution What I'd like to do is the following: Edit a simple script file (e.g., mouse-script.txt ). Add a list of coordinates, movement speeds, delays, and button clicks. For example:

Bluetooth + simulating mouse

一个人想着一个人 提交于 2019-12-03 08:40:22
anyone know if its posible to make an application to simulate a touchscreen mouse or trackpad by bluetooth?? How can I make that the PC (or MAC) knows me as a mouse device? Regards, Juan You should have a look at the Bluetooth HID specification. It may be possible, depending on the stack of the device that you are using to emulate a mouse/trackpad. I'm not familiar with the stack on Android (assuming that's the platform you're using from the tag on your question) so I don't know if it's possible from there. Essentially, you create a HID service on the L2CAP protocol. The service record

Simulate a mouse input on android

落花浮王杯 提交于 2019-12-03 08:29:16
Imagine that I have a service that receives coordinates from a bluetooth device, now I want to display a mouse cursor whenever it moves. I managed to send MotionEvents with a toolType = TOOL_TYPE_MOUSE but I don't get the native android mouse cursor displayed on screen. The events I am sending look like these: 05-14 13:38:05.043: I/onTouchEvent(30301): MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=498.0, y[0]=996.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=251957430, downTime=251957420, deviceId=1, source