mouseevent

Send a flag from server to clients using c# mouse events

ε祈祈猫儿з 提交于 2019-12-07 09:01:09
问题 I am using sockets in c# in order to send data from server to client machine. In fact I have created a capturer which capature kinect stream from 3 different machine. I want to generate a server and client communication in order to send signal from server to the rest devices in order to begin and stop the recording process. I want with left click to send a message to begin recording and with right click to stop recording. My code is the following: public Form1() { InitializeComponent(); this

Elm: adding click events to SVG elements doesn't work – is this possible?

倖福魔咒の 提交于 2019-12-07 08:59:30
问题 I have been attempting to add an on "click" event to an SVG element in Elm in order to determine the relative position of the mouse click within that element. A code sample is given below that you can try running at http://elm-lang.org/try to show how click events on HTML elements seem to work as expected but not on SVG elements. In the sample, Html.on "click" is used rather than Html.onClick to allow the position data to be decoded from the event as explained in this discussion. After

Detecting mouse event in an image with matplotlib

隐身守侯 提交于 2019-12-07 08:30:27
问题 So I'm trying write a program that detects a mouse click on an image and saves the x,y position. I've been using matplotlib and I have it working with a basic plot, but when I try to use the same code with an image, I get the following error: cid = implot.canvas.mpl_connect('button_press_event', onclick) 'AxesImage' object has no attribute 'canvas' This is my code: import matplotlib.pyplot as plt im = plt.imread('image.PNG') implot = plt.imshow(im) def onclick(event): if event.xdata != None

Qt5 C++ automated mouse clicking

廉价感情. 提交于 2019-12-07 07:24:00
问题 I am trying to make an application where the mouse goes to certain locations on screen and automatically clicks left button. The problem is I cant click outside the Qt application so I made a workaround by making the application transparent to mouse clicks and making it full screen using this code: int x = 800; int y = 500; this->setWindowFlags(Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint|Qt::ToolTip); this->setAttribute(Qt::WA_TranslucentBackground); this->setAttribute( Qt::WA

jQuery is mousedown on mouseover

丶灬走出姿态 提交于 2019-12-07 06:47:52
问题 I have a table where i want to change cell background on mouse over and mouse button down, my current solution doesn't work as I want it to : function ChangeColor(sender) { sender.style.backgroundColor = 'yellow'; } var clicking = false; $(document).mouseup(function() { clicking = false; }); $(document).ready(function() { $('#Table1 tr').each(function() { $('td', this).each(function() { $(this).mousedown(function() { clicking = true; }); $(this).mousedown(function(event) { if (clicking==true)

How can I make a window invisible to mouse events in WPF?

我怕爱的太早我们不能终老 提交于 2019-12-07 05:45:16
问题 I created this class, and it works perfectly for make my WPF application transparent to mouse events. using System.Runtime.InteropServices; class Win32 { public const int WS_EX_TRANSPARENT = 0x00000020; public const int GWL_EXSTYLE = (-20); [DllImport("user32.dll")] public static extern int GetWindowLong(IntPtr hwnd, int index); [DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle); public static void makeTransparent(IntPtr hwnd) { // Change

How to detect if mouse is moving when mouseup is fired?

浪子不回头ぞ 提交于 2019-12-07 05:09:42
问题 I've tried to implement a page panorate by dragging. In my implementation the page moves for a while after user has released the mouse button, like dragging maps in Google Maps. Now I'd like to prevent this effect, when the mouse is no longer moving when user releases the button. The problem is, that I just can't figure out how to detect if the mouse really moves when mouseup event is fired. For now I've tried to tackle this problem by calculating the dragging speed and then compare the speed

How can I constrain locators to a limited (but not regular) set of positions?

a 夏天 提交于 2019-12-07 04:51:45
问题 In Mathematica, locators can be constrained to certain screen regions via the parameters of LocatorPane (See LocatorPane documentation.) A list of three ordered pairs {{{minX, minY}, {maxX, maxY}, {dX, dY}}} is usually the key to determining the behavior of locators. {minX, minY} and {maxX, maxY} set the region. {dX, dY} sets the jump size: zero for unrestrained, any other positive number for the size of each hop. In the code below, {{{-.9, 0}, {1, 0}, {0, 0}}} sets the region and jumps for

Workaround for setToolTipText consuming mouse events?

耗尽温柔 提交于 2019-12-07 04:10:02
问题 This seems to be a verified problem with SWING http://forums.sun.com/thread.jspa?threadID=385730 I'm currently trying to set the tooltip text of a tab in a JTabbedPane but when I do I can't actually select the tab anymore because the tooltip added a mouse listener that is consuming the events. Does anyone know of a workaround that allows me to keep my tooltips AND my mouseevents? Thank you. As per request here is my SSCCE package jtabbedbug; import javax.swing.JFrame; import javax.swing

Set mouse position not working c#

落爺英雄遲暮 提交于 2019-12-07 04:06:27
问题 I've been trying to write a small utility that will modify the boundaries of where my mouse can go on the whole screen. I've used the the global mouse hook library that I found here (I'm using version 1), and then pass the mouse position information from the event it generates to my own function (just a test to see it working for now). internal void ProcessMouseEvent(System.Drawing.Point point) { Cursor.Position = new Point(50,50); } When running it, the mouse does appear to flash to the