mouse

Android: Tracking mouse pointer movement

落花浮王杯 提交于 2019-11-30 04:42:45
问题 Assuming that I am using a generic mouse, is it possible to track the X and Y coordinates of the mouse pointer in android? 回答1: You need a OnGenericMotionListener : OnGenericMotion(...., MotionEvent me) { if (me.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) { } api 14+ needed [confirmed] Found me a tablet with usb mouse and can confirm this works for mouse movement. You WILL get flooded with messages, so simple operations or sleeping should be considered. 回答2: The docs to ACTION_MOVE lead me

NodeJS native mouse and keyboard bindings [closed]

走远了吗. 提交于 2019-11-30 04:11:54
I've been looking for a native nodejs module that supports mouse and keyboard listening and execution i found this.. https://npmjs.org/package/mouse but the source code looks like it only supports the browsers. I've been working on a module for sending mouse and keyboard events, 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.x,mouse.y+100); //Left click! robot.mouseClick(); Then for

How can I handle multiple mouse inputs in Java?

别等时光非礼了梦想. 提交于 2019-11-30 03:52:01
A friend of mine asked me to implement a blue and a red pointer to represent the inputs of two separate mice to expedite a mixing desk scenario for real time audio mixing. I'd love to, but as much as I think it is a great idea, I don't have a clue as to where to start looking for a possible solution. Where should I start researching a viable method of implementing dual mouse inputs? Look at jinput . I have had multiple keyboards working with it, I am nearly certain it supports multiple mice too. dont know about java.. but for C#/c++ you can try the Microsoft Windows MultiPoint Software

Device misdetected as serial mouse

我们两清 提交于 2019-11-30 01:23:26
I'm working on a device which communicates with a PC through a (virtual) serial port. The problem is that the data we are sending occasionally gets incorrectly identified by Windows as a bus mouse, after which the "Microsoft Serial Ballpoint" driver is loaded and the mouse pointer starts jumping around on the screen and randomly clicking on things. A bit of Googling reveals that is an old and well-known problem with serial devices where the usual work-around is a bit of registry hacking to disable the offending driver. That it is a lot to demand from our users however and I'd rather not have

Simulate Mouse Clicks on Python

℡╲_俬逩灬. 提交于 2019-11-30 01:21:12
I'm currently in the process of making my Nintendo Wiimote (Kinda sad actually) to work with my computer as a mouse. I've managed to make the nunchuk's stick control actually move the mouse up and down, left and right on the screen! This was so exciting. Now I'm stuck. I want to left/right click on things via python when I press A, When I went to do a search, All it came up with was tkinter? So my question is, What do I call to make python left/right click on the desktop, and if it's possible, maybe provide a snippet? Thank you for your help! NOTE: I guess I forgot to mention that this is for

Simulate mouse on Mac

為{幸葍}努か 提交于 2019-11-29 23:42:49
问题 I have a virtual trackpad on my iPhone and to move my mouse I'm using : CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, CGPointMake(((float)aD.msg)+location.x, ((float)aD.msg2)+location.y)); It's working well but this not a real mouse because when I put my mouse on my hidden dock, this one doesn't display it self. I don't understand why. More over I tried to simulate mouse click with : case MOUSECLICK: [self postMouseEventWithButton:0 withType:kCGEventLeftMouseDown andPoint

Track mouse speed with JS

做~自己de王妃 提交于 2019-11-29 22:29:19
What's the best way to track the mouse speed with plain JS/JQuery? I'd like to track how fast a user moves the mouse in all directions (up/down/left/right). Jonathan Sparklines has a nifty example of tracking mouse movement and graphing it. Their code is available in the source of their site starting at line 315. Simple and effective. Here is the code: var mrefreshinterval = 500; // update display every 500ms var lastmousex=-1; var lastmousey=-1; var lastmousetime; var mousetravel = 0; $('html').mousemove(function(e) { var mousex = e.pageX; var mousey = e.pageY; if (lastmousex > -1)

Limiting mouse to one display on Mac (Potentially using Cocoa)

只谈情不闲聊 提交于 2019-11-29 21:06:55
问题 I've been feverishly searching for a method by which to limit the user's mouse to one display in a multi-display setup on a Mac. I've stumbled upon this question: Cocoa: Limit mouse to screen, I promise I have not duplicated this question. The question did, however, spark an idea in my mind that it might be possible to write a simple application using Cocoa to restrict the mouse to one screen, run this application in the background, and still use my game which has been developed in AS3/Adobe

Android usb mouse right click correct behaviour (ICS)

人盡茶涼 提交于 2019-11-29 19:52:43
问题 Is right click of a USB mouse plugged into android (ics) always designated as the 'back' button? I have one tablet where it isn't. I want to remove the status bar, and still be able to use the tablet with USB mouse. Does anyone know where/how to configure the behavior in android? 回答1: Late answer, but the answer is yes. I am going to provide some more detail on this topic as it is the only topic on the Internet of this type. Default behavior: Android treats this as a back button, with no

[.NET]让Panel对Mouse滚轮事件(Wheel)有感觉,而且能触发Scroll事件

我是研究僧i 提交于 2019-11-29 18:40:24
之前有写了一篇“让Panel对Mouse滚轮事件(Wheel)有感觉”,是透过 SendMessage 的方式去叫 Panel Scroll。 但是却不会触发Panel的Scroll事件。那怎么办呢? 在之前有写了一篇“让Panel对Mouse滚轮事件(Wheel)有感觉”,是透过 SendMessage 的方式去叫 Panel Scroll。 但是却不会触发Panel的Scroll事件。那怎么办呢? 所以我们可以透过Control.FromHandle来取到那个控件,然后再触发该控件的Scroll事件,如下, using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1