mouse-coordinates

matlab get mouse coordinates on image without clicking (on mouse over)

被刻印的时光 ゝ 提交于 2020-01-04 10:17:41
问题 I've been googling for a while to find a solution to this apparently simple problem: getting mouse coordinates in image axes while the mouse is moving (without clicking). I've found that impixelinfoval does exactly this but I'm not able to extract the pixel coordinates from this uicontrol in the script (are they stored in some field?). I've also found that ginput gives you the coordinates but only if you click. Do you know any workaround for one of these two issues? Are you aware of any

How perform a drag (based in X,Y mouse coordinates) on Android using AccessibilityService? [Still Without Solution]

我的未来我决定 提交于 2019-12-31 10:19:44
问题 I want know how to perform a drag on android based in X, Y mouse coordinates? consider as two simple examples, the Team Viewer/QuickSupport drawing the "password pattern" on remote smartphone and the Pen of Windows Paint respectively. All that i'm able of make is simulate touch (with dispatchGesture() and also AccessibilityNodeInfo.ACTION_CLICK ). I found these relevants links, but not know if they can be useful: Perform swipe on screen using AccessibilityService Example 1 Continued gestures

jQuery drag - to get start and stop coordinates

爷,独闯天下 提交于 2019-12-24 17:17:07
问题 Hi I have been looking at jQuery's drag library for a method whereby if I hold the mouse button and drag the mouse, then release the button, I get the start and end coordinates of that drag, based on raw screen pixels. I have drawn a blank on that, and haven't found anything on StackOverlaod either. Can anyone recommend an example? Thanks Graham 回答1: You can use get the events of dragstart and dragend. Try this code <html> <head> <script src="http://code.jquery.com/jquery-1.10.1.min.js"><

get canvas mouse coordinates after transformation using ctx.getTransformation()

不打扰是莪最后的温柔 提交于 2019-12-24 06:40:32
问题 I am using the following function to get mouse coordinates on canvas after performing rotations. function getWindowToCanvas(canvas, x, y) { const ctx = canvas.getContext("2d"); var transform = ctx.getTransform(); var rect = canvas.getBoundingClientRect(); var screenX = (x - rect.left) * (canvas.width / rect.width); var screenY = (y - rect.top) * (canvas.height / rect.height); if (transform.isIdentity) { return { x: screenX, y: screenY }; } else { console.log(transform.invertSelf()); const

three.js 2D mouseclick to 3d co-ordinates using raycaster

≡放荡痞女 提交于 2019-12-13 02:39:42
问题 I'm trying to draw 2D objects in z=0 plane, now I want to convert screen mouse co-ordinates into 3D world co-ordinates. I used camera below: camera = new THREE.OrthographicCamera(SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, NEAR, FAR ); camera.position.set(0,0,500); camera.lookAt(scene.position); container = document.getElementById( 'ThreeJS' ); container.appendChild( renderer.domElement ); var floorGeometry = new THREE.PlaneGeometry(1000, 1000, 10, 10); var

jquery set mouse position inside a <div> graphic area

柔情痞子 提交于 2019-12-11 04:49:59
问题 using http://www.flotcharts.org/ to realize a complex scatterplot graphic with zoom/pan functionalities, i would like to set mouse position at specific coordinates (by example: when doing a zoom in, I would like that cursor would positioned at the center of canvass). It ssem this function doesn't work: function setMousePosition(pos) { var x = pos.x; var y = pos.y; var pointX = ( Math.floor(plot.offset().left + plot.p2c(pos).left) ); var pointY = ( Math.floor(plot.offset().top + plot.p2c(pos)

Three.js - Getting the X, Y, and Z coordinates of mouse click

五迷三道 提交于 2019-12-11 02:32:17
问题 I'm using version 68 of three.js. I would like to click somewhere and get the X, Y, and Z coordinates. I followed the steps here, but they give me a Z value of 0: Mouse / Canvas X, Y to Three.js World X, Y, Z Basically, if I have a mesh in the scene, and I click in the middle of it, I'm hoping to be able to calculate the same values as the position of that mesh. This is just an example . I know I could use raycasting and see if I collided with a mesh and then just check its position. However,

PYTHON- PYGAME: How do I know if a mouse clicked on an image? [duplicate]

时间秒杀一切 提交于 2019-12-07 17:48:46
问题 This question already has answers here : Pygame mouse clicking detection (3 answers) Closed 3 years ago . I'm making a basic level game where if i click a card, a picture will show. The pictures are randomly chosen. and so far, I have assigned random pictures to a card and the cards are shown face down. So if i click the card, i want the assigned picture (which is in a dictionary) to show. I want to know how I can detect if I've clicked on an image (of the card) because the x,y coordinates of

PYTHON- PYGAME: How do I know if a mouse clicked on an image? [duplicate]

早过忘川 提交于 2019-12-05 20:47:53
This question already has an answer here: Pygame mouse clicking detection 3 answers I'm making a basic level game where if i click a card, a picture will show. The pictures are randomly chosen. and so far, I have assigned random pictures to a card and the cards are shown face down. So if i click the card, i want the assigned picture (which is in a dictionary) to show. I want to know how I can detect if I've clicked on an image (of the card) because the x,y coordinates of the image is on the top left. Right now, I'm trying to figure out a way to use the xy coordinates of the mouse click to

Tracking mouse coordinates in Qt

坚强是说给别人听的谎言 提交于 2019-11-30 22:47:42
Let's say I have a widget in main window, and want to track mouse position ONLY on the widget: it means that left-low corner of widget must be local (0, 0). Q: How can I do this? p.s. NON of functions below do that. widget->mapFromGlobal(QCursor::pos()).x(); QCursor::pos()).x(); event->x(); I am afraid, you won't be happy with your requirement 'lower left must be (0,0). In Qt coordinate systems (0,0) is upper left. If you can accept that. The following code... setMouseTracking(true); // E.g. set in your constructor of your widget. // Implement in your widget void MainWindow::mouseMoveEvent