mouse

how to find where a mouse event come from?

浪子不回头ぞ 提交于 2019-12-25 03:06:01
问题 Is there any way to figure out where did a mouse event come from? I mean, if I code a C/C++ program on Windows, and get a mouse click event on it, how can I find if this event come from a mouse driver, a touchpad, or if it was send by an application (mouse event simulation by sending appropriate message like WM_LBUTTONDOWN). Thanks for any help :) 回答1: This is not possible for an application in user mode - mouse events generally don't provide documented info on event source. There is the way

d3 drag behavior not working properly on html elements

蓝咒 提交于 2019-12-25 02:59:42
问题 I want to show multiple charts in a table, each chart is a separate svg, generated with d3. The height of each chart has to be easily adjustable - and I want that to be done in a similar manner as you adjust the 4 panels (html, javaScript, css, output) in jsFiddle, by dragging the mouse over a border between those panels - in my case it's only horizontal borders. I'd like to use d3.behavior.drag(). When the border (a div in a td of the table, or something like that) is dragged, the height of

Setting arc position in Java using Mouse

旧街凉风 提交于 2019-12-25 02:46:44
问题 I am writing a 2D program. On my paintComponent I created an arc. public class Board extends Panel{ protected void paintComponent(Graphics g){ super.paintComponent(g); Graphics2D graphics2d = (Graphics2D)g; int x = MouseInfo.getPointerInfo().getLocation().x;//set mouses current position int y = MouseInfo.getPointerInfo().getLocation().y; graphics2d.setStroke(wideStroke); graphics2d.draw(new Arc2D.Double(200, 200, 100, 100, ?, 180, Arc2D.OPEN)); } } In my main I am using a Thread to update the

How to draw attention to the current mouse location?

自作多情 提交于 2019-12-25 02:19:27
问题 We have an app that hides the desktop icons when the keyboard/mouse are idle for longer than 15 seconds. When the user starts using either of these devices again, we would like to draw their attention to the location of their mouse, much akin to how the CTRL key can be enabled to circle the mouse in Windows. Are there any similar functions or suggestions I could use to perform such a task? I find working with the mouse in a global fashion (Anywhere on the desktop, not just on our app) very

as3 mouse wheel reverse

断了今生、忘了曾经 提交于 2019-12-25 01:58:04
问题 Hey i built custom scroll box. When i scroll up on this box scrolling element is going down and when i scroll down - scrolling element is going up ;). I whant to reverse that mechanism. how can i do it ? Below my code for mouse import flash.events.MouseEvent; function handleMouseWheel(event:MouseEvent):void { if ((event.delta > 0 && box_mc.y < 171) || (event.delta < 0 && box_mc.y > 135)) { box_mc.y = box_mc.y + (event.delta * 3); sb.thumb.y = sb.thumb.y + (event.delta * 13); trace(box_mc.y);

rotate to mouse kinetic js

自作多情 提交于 2019-12-25 01:38:14
问题 I looked at many examples but so far nothing worked. I want the circle to rotate on mousemove and it is rotating centered, so no problems so far. But, it does a 180 jump when I pass half of the stage. So everything is fine till I pass the half of the stage, clearly I'm missing something. Math.atan2 gives me an error: the circle jumps to the (0,0) of the stage. Please help I really need this badly. Thanks in advance! new Kinetic.Tween({ node: cGrad1, x: stage.getWidth()/2, y: stage.getHeight()

Why can't i get different mouse clicks coordinates twice? assembly

℡╲_俬逩灬. 提交于 2019-12-25 01:24:38
问题 I have a small procedure that is supposed to check if there was a click and get the click's coordinates. In the first time, it works but when I call it at the second time it doesn't even let me click again... why? what is wrong? I tried everything, put the mouse setting outside the procedure-didn't do any differences. Also, I tried to create some kind of small thing where you click once, put the cx in si and call sam click check again and comparing si and the new cx and it is different (si is

Mouse button in ToolStripMenuItem

痴心易碎 提交于 2019-12-24 19:25:51
问题 I have a context menu with a few items. One of the items has a submenu (or whatever it's called) with a few items (depends on what files it finds). What I want to do is when I left click one of the sub-items I want one thing to happen, and when I right click I want another thing to happen. My problem is that when I use the filesToolStripMenuItem_DropDownItemClicked, I don't get any MouseEventArgs in the parameter, so I can't find out which mouse button was used to click the item. I tried

JQuery mouseout timeout

☆樱花仙子☆ 提交于 2019-12-24 19:19:05
问题 Similar problems have been dealt with before but I believe mine's slightly different owing to the use of the bind() function. Anyhow... $('.overlay').bind("mouseenter",function(){ $(this).fadeTo('slow', 0); }).bind("mouseleave",function(){ setTimeout(function() { $(this).fadeTo('slow', 1); }, 2000); }); I want to fade out the overlay on "mouseenter", but only fade it back in 2000ms after "mouseleave". I have an additional question: When the .overlay div fades out, I need to be able to click

How can i get the absolute mouse position in Linux in C

↘锁芯ラ 提交于 2019-12-24 16:33:02
问题 As far as i know the two ways to get mouse position are using libgpm or reading /dev/input/mice file. But the latter just returns a relative position from the last position. So my question is how can i get the absolute mouse position though reading /dev/input/mice or other way. And i want to implement this function by C or C++ . Any information will be appreciate. 回答1: First, a mouse device is probably sending only relative movements, so there is no way to get the absolute position (just try