mouseevent

Is it possible to dispatchEvent() a mouse click to a <input type=text> element?

六月ゝ 毕业季﹏ 提交于 2019-12-29 05:06:47
问题 Basically I'm trying to dispatch a custom made mouse click event to a text input element using the following code (see this jsFiddle): function simulateClick(id) { var clickEvent = document.createEvent("MouseEvents"); clickEvent.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); var element = document.getElementById(id); element.dispatchEvent(clickEvent); } When I run that code on a type="checkbox" element it works perfectly fine but it doesn't

Why JScrollPane does not react to mouse wheel events?

故事扮演 提交于 2019-12-28 04:18:06
问题 I have a JScrollPane containing a panel with a BoxLayout (PAGE AXIS). My problem is that the JScrollPane does not react to mouse wheel events. To make it scroll using the mouse wheel i need to be on the JScrollBar . I found this thread and i have no MouseMotionListener or MouseWheelListener , only a MouseListener . I think my problem come from the fact that my JScrollPane act on a JPanel that contains other panels itself. So when the mouse is on a panel within the JScrollPane it seems that

Drag and Resize undecorated JFrame

ε祈祈猫儿з 提交于 2019-12-28 03:59:05
问题 Currently, I am using the following code to drag and move my undecordated JFrames. private void initialiseGUI(Component component){ //<editor-fold defaultstate="collapsed" desc="code"> component.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { posX = e.getX(); posY = e.getY(); } }); component.addMouseMotionListener(new MouseAdapter() { public void mouseDragged(MouseEvent evt) { //sets frame position when mouse dragged Rectangle rectangle = getBounds(); getGUI()

mousewheel event is not triggering in firefox browser

£可爱£侵袭症+ 提交于 2019-12-28 02:58:10
问题 Please refer the below code. $(this.element).on("mousewheel", this.chartMouseWheel); chartMouseWheel:function(e) { if(e.originalEvent.wheelDelta /120 > 0) { alert('scrolling up !'); } else{ alert('scrolling down !'); } if (e.preventDefault) e.preventDefault(); e.returnValue = false; }, this event triggering properly in IE,chrome and not triggering in Firefox ? 回答1: Firefox doesn't recognize "mousewheel" as of version 3. You should use "DOMMouseScroll" instead for firefox. check this: http:/

Pass-through mouse events to parent control

依然范特西╮ 提交于 2019-12-27 11:15:12
问题 Environment: .NET Framework 2.0, VS 2008. I am trying to create a subclass of certain .NET controls (label, panel) that will pass through certain mouse events ( MouseDown , MouseMove , MouseUp ) to its parent control (or alternatively to the top-level form). I can do this by creating handlers for these events in instances of the standard controls, e.g.: public class TheForm : Form { private Label theLabel; private void InitializeComponent() { theLabel = new Label(); theLabel.MouseDown += new

How to know what control the mouse has clicked in a canvas?

别说谁变了你拦得住时间么 提交于 2019-12-25 16:02:30
问题 I am creating a C# WPF application and looking for a way to do the following: I have a canvas with different user controls in it and a button. When I click on the button the cursor change to a hand (Canvas.Cursor = Cursors.Hand) Then if I click on one of the controls I get a message box showing the name of the control clicked (the name is a public property of the control). If I click somewhere else i the cursor resets and I should click on the button again before I can get the name again. I

How to know what control the mouse has clicked in a canvas?

落花浮王杯 提交于 2019-12-25 16:01:45
问题 I am creating a C# WPF application and looking for a way to do the following: I have a canvas with different user controls in it and a button. When I click on the button the cursor change to a hand (Canvas.Cursor = Cursors.Hand) Then if I click on one of the controls I get a message box showing the name of the control clicked (the name is a public property of the control). If I click somewhere else i the cursor resets and I should click on the button again before I can get the name again. I

Determine which JavaFX ListView item was clicked on without selecting it

百般思念 提交于 2019-12-25 09:31:06
问题 My JavaFX application has a ListView that contains items that need to be processed. I have two buttons that the user can click to process the next item in the list (i.e. a "forward" button), or to undo the processing of the last item in the list (i.e. a "back" button). I don't want them to arbitrarily select items in the list (they should only be able to move around using those two buttons). However, I would like them to be able to right click on items to get some contextual menu (e.g. like

PyQt4 - detect global mouse click

给你一囗甜甜゛ 提交于 2019-12-25 07:59:31
问题 A part of a small project I am working on involves 'calibrating' the coordinates of the screen of which to take a screen capture of. By the 'screen', I refer to the entire desktop, not my GUI window. The coordinates are calibrated when a QDialog window appears (which I've subclassed). The user is prompted to click several locations on the screen. I need the program to record the locations of all mouse clicks occuring anywhere on the screen - ones that don't natively trigger a QDialog

d3.js mouse events not working

谁都会走 提交于 2019-12-25 06:59:36
问题 I have the following problem: I made a force graph containing of only nodes rendered as circles. Everything worked fine, I could change the color on hover, click on them and delete some. I wrote this function to get the desired behavior depending on which data value is passed. It worked this morning but when I tried to show a friend what I had made suddenly the interaction stopped working completely. I don't get any error messages. Somehow something is wrong with the .on(mouseover) .on