mouseevent

Console application freezes on mouse click

社会主义新天地 提交于 2020-01-09 10:51:16
问题 I have a very simple C# console application that displays some text and loops waiting for input until the escape key is pressed or the timeout period is served. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; namespace SampleApp { public static class Program { public static void Main (string [] args) { var key = new ConsoleKeyInfo(); var watch = Stopwatch.StartNew(); var timeout = TimeSpan.FromSeconds(5);

Event listener hover changing other element

风格不统一 提交于 2020-01-07 02:51:30
问题 I made this script for showing/hiding other div that comes to place of the one with event (ricon1) on mouse in and out: HTML: <div class="rule-container"> <div class="rule" id="rule1"> <div class="rule-icon" id="ricon1"> </div> <div class="rule-decription" id="rdescription1"> </div> </div> <div class="rule" id="rule2"> <div class="rule-icon" id="ricon2"> </div> <div class="rule-decription" id="rdescription2"> </div> </div> <div class="rule" id="rule3"> <div class="rule-icon" id="ricon3"> <

Why is my mousePressEvent called twice?

[亡魂溺海] 提交于 2020-01-07 01:21:16
问题 I want to make a QLabel clickable and followed this "how-to". I was not sure how to get this piece of code into my GUI (I am quite newbie to qt). What I did was: I created a new class (just copy/paste of ClickableLabel from the link, but I changed the signal to clicked(QMouseEvent* event) ) I added a QLabel to my GUI and "promoted" it to a ClickableLable I connected the signal to a slot of my main window where I std::cout some stuff: connect(this->ui->label,SIGNAL(clicked(QMouseEvent*)), this

ActionScript3: removeEventListener with function parameter

纵饮孤独 提交于 2020-01-06 20:24:38
问题 how can i remove EventListener from MovieClip in actionscript? Below is my sample code. import flash.events.MouseEvent; import flash.geom.ColorTransform; var color: ColorTransform = new ColorTransform(); color.color = 0x00CC66; colorChange_mc.buttonMode = true; colorChange_mc.addEventListener(MouseEvent.MOUSE_OVER, changeColor(color)); colorChange_mc.addEventListener(MouseEvent.MOUSE_OUT, changeColorToNormal); function changeColor(color: ColorTransform): Function { return function (e:

html canvas trap left click and allow right click to pass through (pointer-events)

折月煮酒 提交于 2020-01-06 15:31:29
问题 The use case is that I have an html canvas on top of several html elements which listen for right click mouse events. I want to draw on the canvas using left mouse button, and at the same time interact with underlying html elements using right click. I get that I can allow all mouse events to pass through the canvas by setting css property pointer-events to none. However I want to allow only right click to pass through it. One way to achieve this may be to listen on the canvas for right click

Trigger event from child to parent in AS3

梦想的初衷 提交于 2020-01-06 08:32:29
问题 I have a MovieClip with a MouseEvent function associated to CLICK event. Inside of this MovieClip I have a TextField. So, when I click on my MovieClip, the handler works fine. Now I need the same behaviour when I click on this TextField, but without change my handler function. I mean, I don't want to change e.target to e.target.parent if user clicked on TextField instead of MovieClip. How can I do this? Some of my source code: public function Main(){ var m = new menu(); menuMng.addChild(m); m

Trigger event from child to parent in AS3

寵の児 提交于 2020-01-06 08:31:27
问题 I have a MovieClip with a MouseEvent function associated to CLICK event. Inside of this MovieClip I have a TextField. So, when I click on my MovieClip, the handler works fine. Now I need the same behaviour when I click on this TextField, but without change my handler function. I mean, I don't want to change e.target to e.target.parent if user clicked on TextField instead of MovieClip. How can I do this? Some of my source code: public function Main(){ var m = new menu(); menuMng.addChild(m); m

Mouse Jumping when I enter a label

半腔热情 提交于 2020-01-06 07:20:47
问题 A bit ago I posted a question on cursors here and I was wondering how do I get the cursor to stop jumping so what I mean is then I enter the jlabel it shows it like normal and then after a couple of seconds it jumps to a different place now when I added the frame drag method I added this code to stop this form happening this.setLocation(x - xMouse, y - yMouse); But I was wondering how would add it into this method Toolkit toolkit = Toolkit.getDefaultToolkit(); Image image = toolkit.getImage(

Mouse Jumping when I enter a label

感情迁移 提交于 2020-01-06 07:18:10
问题 A bit ago I posted a question on cursors here and I was wondering how do I get the cursor to stop jumping so what I mean is then I enter the jlabel it shows it like normal and then after a couple of seconds it jumps to a different place now when I added the frame drag method I added this code to stop this form happening this.setLocation(x - xMouse, y - yMouse); But I was wondering how would add it into this method Toolkit toolkit = Toolkit.getDefaultToolkit(); Image image = toolkit.getImage(

Disable contextmenu and rightclick menu

不打扰是莪最后的温柔 提交于 2020-01-06 03:52:04
问题 $(document).on('mousedown', 'a', function(event){ event.preventDefault(); if(event.which == 1){ if($(this).attr('target') != '_blank'){ loadpage($(this).attr('href')); } } }).on('contextmenu', 'a', function(event){ event.preventDefault(); }); Hello once again Stackoverflow! For my current project I want to disable the right and middle mouse button on every link. And when clicked on with the left mouse button, if the link doesn't contain target="_blank" , I need to call a function that loads