mousemove

Multiple canvas layers and mousemove

ぃ、小莉子 提交于 2019-12-12 03:28:09
问题 I'm trying to use a mousemove event on a canvas, inspired from Wayne's answer here, and the corresponding fiddle. The problem is, I'm working with a code which creates "layered" canvas in the following way: // canvas data layers ["marks", "foreground", "brushed", "highlight", "clickable_colors"].forEach(function(layer, i) { canvas[layer] = selection .append("canvas") .attr({ id: layer, //added an id for easier selecting for mouse event class: layer, style: "z-index: " + i +10000000 })[0][0];

Protractor Drag And Drop

一笑奈何 提交于 2019-12-12 02:59:13
问题 I have a list of elements so i want to write a function to drag those elements into a container that builds up an object. At the moment in my protractor tests I have found the element. The element is present and is displayed. The only place I'm running into problems is when I try to translate or drag and drop its position on the screen. At the moment i'm using browser.actions().dragAndDrop(element1.getWebElement(), { x: -500, y: 20 }).perform(); In order to try drag it -500px to the left and

Detect Mousemovent inside of blur function Jquery

﹥>﹥吖頭↗ 提交于 2019-12-12 01:29:34
问题 I am trying to create a neat way to stop an AJAX called based upon if the browser is in focus, and if the mouse moves.. So here's what I want it to do: If the user goes to a different tab in their browser, minimized the window, or goes somewhere else other than the web app, I want it to kill the AJAX calls in 1 minute. If the user moves the mouse anywhere in the web app, it should consider the user "focused" on the app, and thus continue the ajax calls. I put a timeout called "st" in there to

Qt: MouseMove not functioning

早过忘川 提交于 2019-12-11 13:14:21
问题 In my Qt application, I need to track mouse movement. For that, I created an eventfilter and I installed it correctly as this: bool iArmMainWindow::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::MouseMove)//not working { iarm->printStatus("hi"); //this is for debugging } if (event->type() == QEvent::MouseButtonPress){ //Here some staff working correctly } //other staff } The problem is that the event type MouseMove does not work. Any idea? 回答1: You should say to Qt,

MouseMove issue on canvas

北城余情 提交于 2019-12-10 14:39:44
问题 I'm attempting to get a square shape to follow my mouse around on the canvas using "mousemove". function start(){ var canvastmp = document.getElementById("myCanvas") var canvas = canvastmp.getContext("2d"); window.addEventListener('mousemove', trevor, false); } function trevor(pos){ canvas.clearRect(0,0,600,400); var x = pos.clientX; var y = pos.clientY; canvas.fillRect(x-25,y-25,100,100); } window.addEventListener('load',start,false); When I run it, nothing at all shows up. I've been

Robot.mouseMove not moving to specified location properly

别等时光非礼了梦想. 提交于 2019-12-10 13:05:31
问题 Whenever I run a mouseMove command for a robot, the mouse doesn't always go to the same location. For example, I have the following code: import java.awt.Robot; import java.util.concurrent.TimeUnit; public class MainBot { public static void main(String[] args){ try { Robot screenWin = new Robot(); TimeUnit.SECONDS.sleep(2); screenWin.mouseMove(100, 300); } catch (Exception e) { e.printStackTrace(); } } } The code usually makes the mouse end up at the X: First, I hit run (I am using eclipse)

How can I reduce slowdowns from mousemove event?

ぃ、小莉子 提交于 2019-12-10 11:41:31
问题 I'm running a relatively simple function (update a span 's innerHTML ) on mousemove . The application is a Leaflet map. When the mouse is moving, there is palpable lag when zooming, panning and loading tiles. I only need to update the span about 10-20 times per second at most. (See here for the page in question; the update is for the X/Z indicator in the upper-right corner.) What's the best way to delay and/or defer mousemove event calls? Is it good enough to skip updating innerHTML ? Can I

How can I access an iframes document event mouse position from the parent window using javascript and or jquery

混江龙づ霸主 提交于 2019-12-10 10:46:47
问题 I have an iframe inside of a parent window, with both the iframe src and the parent located in the same domain. In order to keep the iframe document clear of javascript I want to be able to use a function in the parent window to get the the mouse position inside the iframe. My attempts at this so far have included: <iframe id="iframe1" src="test.html" style="position:relative; width:500px; height:500px"></iframe> <div id="result" style="border:1px solid black"></div> <script> $(document).bind

How to track mouse movements without limiting it to screen size?

五迷三道 提交于 2019-12-10 10:27:46
问题 I'm using WM_MOUSEMOVE to get changes in mouse position. When simulating "knobs" for example it's desired to let the user go up/down with mouse without any limits. In this cases I hide cursor and use SetCursorPos to change its position every time user moves with it and detect just the difference from the original position. Unfortunately it doesn't seem to work - if I set the mouse position, it sometimes works, but sometimes is one or more pixels away, which is just wrong. And even bigger

Prevent WPF ListBox from selecting item under mouse when layout changes

末鹿安然 提交于 2019-12-09 18:38:32
问题 If a WPF ListBox gets a MouseMove event while the mouse button is held down, it will change the listbox's selection. That is, if you click the mouse on item #1, and then drag over item #2, it will deselect item #1 and select item #2 instead. How can I prevent this? That's the short version. The slightly longer version is this: When the user double-clicks an item in my ListBox, I make other changes to my layout, which includes showing other controls above the ListBox. This moves the ListBox