mouse

How to record the mouse movement until a key is pressed with Python?

谁都会走 提交于 2019-12-11 05:22:31
问题 I want to make the function mouse.record() run until a key is pressed, rather than a mouse button. The mouse.record() is a function from the python module mouse : ( mouse/__init__.py ) def record(button=RIGHT, target_types=(DOWN,)): """ Records all mouse events until the user presses the given button. Then returns the list of events recorded. Pairs well with `play(events)`. Note: this is a blocking function. Note: for more details on the mouse hook and events see `hook`. """ recorded = []

How to capture mouse cursor in Java?

纵然是瞬间 提交于 2019-12-11 05:11:50
问题 Ok, Most of you will think it's a duplicate because it's already written everywhere that it's not really doable and the only option is to do a screenshot using awt robot. But... The issue is that the mouse cursor does not even appear in the picture produced by AWT robot... I tries gnome-screeshots and there I can see the mouse cursor. But from the java screenshot, nothing. The entire picture, but not mouse cursor. It's like it's hidding it before taking the picture. I search for a parameter

javascript resize with mouse

我是研究僧i 提交于 2019-12-11 05:08:41
问题 I'd like to let my users resize a div from the 4 corners or the 4 sides with the mouse. I whish to use just Javascript, no JQ library please... A tiny little resize image in the right bottom corner would be a plus! Thanks 回答1: Use CSS3 resize: both; , as seen here: http://dhtmlexamples.com/2011/01/20/creating-a-user-resizable-div-tag-using-css3/ <style type="text/css"> .isResizable { background: rgba(255, 0, 0, 0.2); font-size: 2em; border: 1px solid black; overflow: hidden; resize: both;

Weird values from WM_INPUT, casting mistake?

冷暖自知 提交于 2019-12-11 05:08:29
问题 About I am trying to get the raw mouse input of the system into a C# application. I am using WM_INPUT (MSDN link) to get access to the data. To do so I am using the user32.dll. This (stackoverflow link) helped me alot with writing the API Wrapper. Current approach The following snippet shows the WndProc method. rimTypeMouseCount already shows that the windows messages seem to get fetched correctly. When I turn the polling rate of my mouse up or down I can see this also by checking the count -

how to add mouse events to force directed graph using the d3 canvas renderer?

試著忘記壹切 提交于 2019-12-11 04:52:33
问题 All the other examples have mouse events with svg.append().... I don't know where to "enter" to get the arcs in a canvas renderer and add .on('click', function(){}) in v4 style. I want to click to get the value of d . Where do I add the handler in this example? I understand the old way below this example. Might something like this work? d3.select(canvas).call(d3.mouse()).on("click", ...) link to working example var links = d3.range(nodes.length - 1).map(function(i) { return { source: Math

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)

JQuery UI selectable plugin - Multiple mouse drag selection and unselect option

余生长醉 提交于 2019-12-11 04:06:01
问题 I am using the JQuery UI selectable plugin to select table cells, here is the example code: http://jsbin.com/ejewes/edit#javascript,html,live I want to make changes to this so that I am able to 1. do multiple mouse drag selects (without using the ctrl key) 2. deselect cells by drag or click on single/multiple selected cells I went through related questions on this forum, but no solution has worked for me so far! Can anybody please help me customize this plugin or point me to some resource

How to get the mouse button state in Silverlight outside of button press events?

醉酒当歌 提交于 2019-12-11 04:04:22
问题 I have the following situation I handle when the left mouse button is pressed in my Silverlight app and do some things while the mouse is held down and the mouse moves. When the left button is released, I turn off the flag that's telling it to do the stuff and the mouse movement handler then no longer does the stuff. The problem is: if the user is in the control area, pushes the left button down and moves out of the control area, then releases the button and reenters, the MouseLeftButtonUp

Which API can be used to _capture_ the mouse when moving OS X “Carbon” windows?

扶醉桌前 提交于 2019-12-11 04:03:21
问题 On request I have implemented support for moving an OS X window by dragging it using an area within the content part of the window, i.e replicating the drag and move functionality of the title bar but in another area. The problem I have yet to resolve is the fact that if the user drags the mouse quickly it can leave the window area and then no more mouse move events are received. On windows this type of problem can simply be fixed by calling the win32 method SetCapture(), what's the

Determine whether the mouse is over a control? (over a Control pixel range)

て烟熏妆下的殇ゞ 提交于 2019-12-11 03:44:34
问题 I'm trying to write a function that should determine whether the mouse is over a range in pixels (the pixel range of a specific Control) The problem is that the function only works for the bounds of the Form , don't work for buttons or any other control that I've tested ...what I'm missing? ''' <summary> ''' Determinates whether the mouse pointer is over a pixel range of the specified control. ''' </summary> ''' <param name="Control">The control.</param> ''' <returns> ''' <c>true</c> if mouse