mouseevent

Mouse callback event flags in python/opencv/OSX?

烂漫一生 提交于 2020-01-03 05:47:08
问题 I'm using OpenCV in python on OSX(10.10.5). I'm just starting out, so I may have made a silly mistake here. However, I haven't found anything that addresses this issue. I have a mouse callback function that makes a list containing the coordinates of each point that is clicked on in a loaded image. Now I'd like to use the flags in the mouse callback function to control whether I append coordinates to the list or whether I instead append "NA,NA" (e.g. if a point is missing from an image, I

C# WebBrowser send Mouse Click Event to Flash Object

我怕爱的太早我们不能终老 提交于 2020-01-03 05:16:12
问题 I've been reading around but didn't seem to find an answer to this question. The objective is: I have a WebBrowser in a Windows Forms Project. There is a HTML page loaded, and in that HTML page there is a Flash Object. My goal is to send a Mouse Click to (x, y) positions of that Flash Object. The (desired) Requisites The window with the Windows Forms executable doesn't need to be active in order for this to work The mouse must not be captured Send a mouse click based on coordinates (x, y),

Mouse movement for session timeout in GWT

北慕城南 提交于 2020-01-02 11:03:43
问题 I'm working on GWT. In my application I want to add a session time out after 2 minutes when no action is performed (including mouse events). I wrote a class in which I used a GWT session object. public static boolean ValidSession(HttpSession session) { boolean aResult = true; logger.debug("Start of ValidSession"); try { if(session!=null ) { String strUserInf=""; strUserInf=(String)session.getAttribute("userInf"); logger.debug("User Inf in session is: " + strUserInf); if(strUserInf==null ||

On CTRL+MOUSEWHEEL event

≯℡__Kan透↙ 提交于 2020-01-02 07:05:03
问题 I was asked to implement ctrl+mousewheel event for our page site in order to change image offset on user zoom in or zoom out. I found this old answer Override browsers CTRL+(WHEEL)SCROLL with javascript and I`ve tried to do the same. I downloaded the jQuery Mouse Wheel Plugin for the implementation and here is my code: var isCtrl = false; $(document).on('keydown keyup', function(e) { if (e.which === 17) { isCtrl = e.type === 'keydown' ? true : false; } }).on('mousewheel', function(e, delta) {

On CTRL+MOUSEWHEEL event

拥有回忆 提交于 2020-01-02 07:03:35
问题 I was asked to implement ctrl+mousewheel event for our page site in order to change image offset on user zoom in or zoom out. I found this old answer Override browsers CTRL+(WHEEL)SCROLL with javascript and I`ve tried to do the same. I downloaded the jQuery Mouse Wheel Plugin for the implementation and here is my code: var isCtrl = false; $(document).on('keydown keyup', function(e) { if (e.which === 17) { isCtrl = e.type === 'keydown' ? true : false; } }).on('mousewheel', function(e, delta) {

Python time counter in Pygame-mouse events

房东的猫 提交于 2020-01-02 04:16:05
问题 I want to calculate the time of user's mouse events in Pygame, if user doesn't move his mouse about 15 seconds, then I want to display a text to the screen. I tried time module for that, but it's not working. import pygame,time pygame.init() #codes ... ... font = pygame.font.SysFont(None,25) text = font.render("Move your mouse!", True, red) FPS = 30 while True: #codes ... ... start = time.time() cur = pygame.mouse.get_pos() #catching mouse event end = time.time() diff = end-start if 15 < diff

How to check if two controls are overlapping in Windows Forms

泪湿孤枕 提交于 2020-01-02 02:01:11
问题 I have created a class that allows the user to drag panels on a forms. How can I ensure that the user does not place two panels on top of each other? If they do, I would like to shift/or highlight one of the control while they are both overlapped. I tried setting this in OnMouseDown event but that didn't quite work. Also, the number of panels on the form vary depending on the number of pictures the form needs to show. Each panel has a picturebox inside the panel. 回答1: A much better approach

How to detect when mouse has stopped

非 Y 不嫁゛ 提交于 2020-01-02 01:54:31
问题 I have written the following JavaScript code. I am using it to detect when the mouse is moving and when it has stopped. MouseStopped() function is a loop of hundreds of items that will tell me where the mouse has stopped, so I want to call it only when the mouse has stopped. var CheckMovement; var stopLoop = false; var n = 0; canvas.addEventListener('mousemove', function (evt) { CheckMovement = setInterval(function () { HasMouseStopped(evt) }, 250); }, false) function HasMouseStopped(evt) {

WPF StackPanel with Click AND DoubleClick

末鹿安然 提交于 2020-01-01 09:28:10
问题 I need to be able to handle the double click and single click event on the WPF StackPanel. But there is no such thing as the StackPanel's DoubleClick Event. I want to do 2 different operations in these 2 EventHandlers. Any idea how to do that? Thank you 回答1: The best way is to right your own mouse button handler with a timeout - if the event is fired again within the timeout period, then fire your doubleclick message, otherwise call the single click handler. Here's some sample code ( Edit:

WPF: Change background color of border on left mouse button down

…衆ロ難τιáo~ 提交于 2020-01-01 06:26:31
问题 Below is a style I use for buttons in my application. Now I'm trying to change the background color of the Border element that has the name "Background" when the user clicks the button with the left mouse button. How do I do that? <Style TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border BorderBrush="#6e6964" BorderThickness="1" CornerRadius="1" Margin="{TemplateBinding Margin}" SnapsToDevicePixels="True"> <Border