mouseevent

Tkinter: Draw rectangle using a mouse

独自空忆成欢 提交于 2019-12-17 19:52:16
问题 Please, help me to resolve this problem. I want to allow the user to draw a random rectangle around a specific region of interest in a picture using the mouse ( by clicking the right or left button of the mouse until he releases it). I deal with large images (images larger than the resolution of my screen, such as this one), so the user needs to scroll the window in order to be able to see the picture fully. Here is the code I tried just to display a large picture, but I have no idea on how

How can a control handle a Mouse click outside of that control?

偶尔善良 提交于 2019-12-17 18:36:07
问题 I'm writing a custom control and I'd like the control to switch from an editing state to it's normal state when a user clicks off of the control. I'm handling the LostFocus event and that helps when a user tabs away or if they click on to another control that's Focusable. But if they don't click on something Focusable, it won't switch out of it's editing state. So I have two solutions in mind: Walk up the tree to the top most element when it goes in to an editing state and add a handler for

How can I simulate mouse events from code?

心不动则不痛 提交于 2019-12-17 18:33:32
问题 I would like to simulate mouse events using the Win32 API; how can I do it? What I want to do is simulate the event at the most basic level, the level at which the system has just the event type and the co-ordinates and hasn't yet figured which window it must relay it to. I don't know if that's how things work. Either way, I need help doing it. Would I have to meddle at the driver level?! To make my requirements clear, I don't want to target any window, I just want the system to think the

How do I add a .click() event to an image?

五迷三道 提交于 2019-12-17 18:28:29
问题 I have a script that places an image based on a mouse click thanks to Jose Faeti. Now I need help adding a .click() event to the code below so that when a user clicks the image it performs the function shown in the script. <img src="http://soulsnatcher.bplaced.net/LDRYh.jpg" alt="unfinished bingo card" />.click() I put the entire code below, in case you want to see it. <html> <head> <script language="javascript" type="text/javascript"> <!-- document.getElementById('foo').addEventListener(

How do I add a .click() event to an image?

旧城冷巷雨未停 提交于 2019-12-17 18:28:20
问题 I have a script that places an image based on a mouse click thanks to Jose Faeti. Now I need help adding a .click() event to the code below so that when a user clicks the image it performs the function shown in the script. <img src="http://soulsnatcher.bplaced.net/LDRYh.jpg" alt="unfinished bingo card" />.click() I put the entire code below, in case you want to see it. <html> <head> <script language="javascript" type="text/javascript"> <!-- document.getElementById('foo').addEventListener(

An “if mouseover” or a “do while mouseover” in JavaScript/jQuery

馋奶兔 提交于 2019-12-17 16:34:35
问题 Is there a JavaScript or jQuery solution to run a function repeatedly (after setTimeout ) while the mouse is over a DOM object? Otherwise said, is there a JavaScript "do while mouseover" (or "if mouseover")? $('someObject').bind('mouseover', function() { //Do the following while mouseover $('someOtherObject').css('margin-left',adjustedLeft + 'px'); setTimeout(/*do it again*/,25); }); 回答1: $('someObject').on('mouseenter', function() { this.iid = setInterval(function() { // do something }, 25);

Move Mouse Cursor Javascript

十年热恋 提交于 2019-12-17 16:28:43
问题 I'm building a joke microsite for a company. They want a feature where the mouse cursor will randomly change position when the user hovers over a certain image. Is this possible in Javascript? How would I implement it? Thanks! 回答1: You can't... but you can - in a way. What you can do to mimic this behavior is that you can hide the actual cursor with css cursor: none and then create an image representing the cursor which would look the same and would be placed in position of the real cursor.

Mouse movement events in NCurses

浪子不回头ぞ 提交于 2019-12-17 16:28:01
问题 I wonder if there is such a thing as mouse movement events in NCurses, and if there is a way to catch them. Following the Interfacing with the mouse (from the NCurses programming HOWTO) it seems that by enabling the REPORT_MOUSE_POSITION bit in the call to mousemask , one can indeed catch mouse movement events. So, I tried that and it does not seem to work. I have something like this: int ch, count=0; mmask_t old; initscr (); noecho (); cbreak (); mousemask (ALL_MOUSE_EVENTS | REPORT_MOUSE

Need help to open a subchart from a main chart?

落花浮王杯 提交于 2019-12-17 15:01:50
问题 I have the following chart: Now my problem is I want to open a new chart containing the information for Linux OS when a user clicks on Linux portion of chart, shown in red. I have tried this: //check if Linux OS is clicked on chart... if("Linux".equals(chartMouseEvent.getEntity().getToolTipText())) { //open new chart having the information for Linux } But I think there may be some better alternate to do the same job. So please help if you know how to achieve this. 回答1: ChartEntity is a good

Java mouse motion anywhere on screen

▼魔方 西西 提交于 2019-12-17 11:54:13
问题 I'm sure this is possible but all my searching is coming up blank. In Java is it possible to register for a mouse motion event outside of a Java app? So if the mouse pointer moves anywhere on the screen I get a call back. An approximation is possible with polling MouseInfo.getPointerInfo but there must be a better way. Thanks To explain the use case: It's just for a pet project but basically firing events when the mouse hits the edge of the screen. I was also thinking that different events