mouse

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

♀尐吖头ヾ 提交于 2019-12-21 05:02:23
问题 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,

Get the mouse coordinates when clicking on canvas

被刻印的时光 ゝ 提交于 2019-12-21 04:37:14
问题 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

How to move mouse with c++

一笑奈何 提交于 2019-12-21 02:57:51
问题 I want to move the mouse cursor with a c++ script. I am using Visual C++ 2010 Express in a Windows 7 inside Parallels and I created a console application. I know SetCursorPos method but it is just not working (it does nothing). I managed to simulate clicks with SendInput but it does not actually move the mouse. This is my code: #include <Windows.h> #include <Tlhelp32.h> #include <stdio.h> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <time.h> void

Difference between Mouse Listener and Action Listener?

烈酒焚心 提交于 2019-12-21 02:53:47
问题 Whats the difference? When would you use a mouse listener? or a action listener? Please and Thank You! 回答1: ActionListener Doc's The listener interface for receiving action events. The class that is interested in processing an action event implements this interface, and the object created with that class is registered with a component, using the component's addActionListener method. When the action event occurs, that object's actionPerformed method is invoked. MouseListener Doc's The listener

Simulate a mouse input on android

别说谁变了你拦得住时间么 提交于 2019-12-21 02:36:08
问题 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,

How can I make a Windows 8 Metro scrollviewer respond to mousewheel?

放肆的年华 提交于 2019-12-20 23:47:20
问题 I'm currently writing an app for Windows 8 using Metro and C#. In my app I use a combination of scrollviewer and gridview to show my data. My problem is however, how can I make it scrollable with a mouse wheel? In my searching I found MouseWheelParameters located in System.Windows.Input, but when I try to use the get_pageTranslation, it gives an error stating I can't explicitly use the get method. 回答1: The "get_pageTranslation" is actually the "PageTranslation" property on the

How I can attach the mouse movement (pyautogui) to pyvirtualdisplay with selenium webdriver (python)?

不打扰是莪最后的温柔 提交于 2019-12-20 14:24:03
问题 I am trying to automatize a website how have a SWF inside. I cant move the mouse with selenium, because is a SWF,so to fix this I use the pyautogui library. Everything works fine!, but! when I use pyvirtualdisplay to hide the navigator the mouse is not attached, so I still see how pyautogui move my mouse. My example code: from selenium import webdriver from pyvirtualdisplay import Display import pyautogui display = Display(visible=1, size=(1600,900)) display.start() driver = webdriver.Firefox

Control the mouse cursor using C#

ぐ巨炮叔叔 提交于 2019-12-20 13:19:41
问题 I'm trying to write a program using C# that would allow me to remotely take control of the mouse on a windows machine. This would allow me to issue commands to the mouse to move to a certain part of the screen and then click on that part of the screen. I was wondering if there were any C# classes that I would be useful in achieving this goal. Any help is appreciated. Thanks! 回答1: I think unless you're just positioning the cursor over your own application, you have to use a windows api call.

Protractor - does anybody know how to click on element with RIGHT MOUSE BUTTON?

巧了我就是萌 提交于 2019-12-20 12:40:55
问题 I know that protractor click on element by default with left mouse button. How to do it to click with RIGHT MOUSE BUTTON ? el.click('RIGHT'); ? 回答1: I would have done like this: browser.actions().mouseMove(el.find()).perform(); browser.actions().click(protractor.Button.RIGHT).perform(); Based on what I saw in actionsequence.js and Protractor rightClick issue #280 回答2: The accepted solution for this question isn't the best way to go about this. Browser actions' .click() method accepts an

Awesome CSS Effect

空扰寡人 提交于 2019-12-20 09:20:34
问题 404 Page or 500 Page Anyone have any idea how to do this sort of thing? The animation that moves with your mouse? Thanks for the correction, @Alin. Just a link to a tutorial would be nice. EDIT: Just also learned it's the parallax effect. That should help. 回答1: The effect is accomplished with javascript, not just CSS. The source code is on the page you linked to. Have a look at jParallax, which makes it easy to implement the effect in a robust way on your own site: http://stephband.info