Questions tagged [mouseclick-event]

An event that is triggered when a Mouse input device is clicked

A MouseClickEvent is an event that is triggered when a button on a Mouse input device is clicked. The event contains information such as the particular button that was clicked, the length of time that the button was pressed, and how many times the button was clicked (single-click, double-click, etc)

632 questions
578
votes
28 answers

Disallow Twitter Bootstrap modal window from closing

I am creating a modal window using Twitter Bootstrap. The default behavior is if you click outside the modal area, the modal will automatically close. I would like to disable that -- i.e. not close the modal window when clicking outside the…
user1296175
  • 5,831
  • 3
  • 15
  • 10
158
votes
8 answers

How to simulate a mouse click using JavaScript?

I know about the document.form.button.click() method. However, I'd like to know how to simulate the onclick event. I found this code somewhere here on Stack Overflow, but I don't know how to use it :( function contextMenuClick() { var element=…
Nok Imchen
  • 2,802
  • 7
  • 33
  • 59
126
votes
5 answers

How to simulate a click by using x,y coordinates in JavaScript?

Is it possible to use given coordinates in order to simulate a click in JavaScript within a webpage?
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
105
votes
16 answers

Attaching click to anchor tag in angular

I am trying to attach click event to anchor tags (coming from ajax) and block the default redirection. How can I do it in angular ?
55
votes
5 answers

Angular2 How to trigger (click) event without clicking

I want to pass data from HTML to the component so I've created an event like this:
월 8회 {{r.value['charge']}}
And in component:…
Lea
  • 1,245
  • 5
  • 22
  • 31
39
votes
9 answers

How to use jQuery to show/hide divs based on radio button selection?

I have some radio buttons and I'd like to have different hidden divs show up based on which radio button is selected. Here's what the HTML looks like:
29
votes
1 answer

Marker mouse click event in R leaflet for shiny

How can I receive a mouse click event on a marker in a leaflet map in R? I'm using the RStudio/leaflet and running through Shiny. I'd like to get the value of a marker (e.g., ID) and use that to update a sidebarPanel.
RCG
  • 291
  • 1
  • 3
  • 3
28
votes
6 answers

NSTableView: detecting a mouse click together with the row and column

I'm trying to detect when a mouse click occurs in an NSTableView, and when it does, to determine the row and column of the cell that was clicked. So far I've tried to use NSTableViewSelectionDidChangeNotification, but there are two problems: It…
bright
  • 4,700
  • 1
  • 34
  • 59
25
votes
6 answers

Prevent middle mouse click scrolling

I'm looking for a way to stop the middle mouse click from causing the browser to start scrolling, and showing the little scroll 'compass'. I have seen Disabling middle click scrolling with javascript however the solution is a bit more hackey than I…
elwyn
  • 10,360
  • 11
  • 42
  • 52
25
votes
12 answers

how to obtain mouse click coordinates outside my window in Java

I need to implement a class, using Swing, which can obtain the mouse coordinates when the user clicks anywhere on the screen. if I wanted to obtain the mouse coordinates inside my own window, I'd use a MouseListener, but I want it to work even when…
cd1
  • 15,908
  • 12
  • 46
  • 47
24
votes
4 answers

Javascript mouse click coordinates for image

The assignment says "Your task is to write an HTML file that contains JavaScript that will randomly display one of the images above. If the page is refreshed in the browser, you should get another random image." so I did it. Now it says "When the…
17
votes
2 answers

WPF: Button single click + double click issue

I have to handle both the single click and the double click of a button in a WPF application with different reaction. Unfortunately, on a doubleclick, WPF fires two click event and a double click event, so it's hard to handle this situation. It…
Hunsoul
  • 175
  • 1
  • 1
  • 6
17
votes
1 answer

How to draw a point (on mouseclick) on a QGraphicsScene?

I have the following code to set up a QGraphicsScene. I wish to click on the scene and draw a point at the location I've clicked. How could I do this? This is my current code: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), …
user189320
16
votes
1 answer

How do websites end up breaking middle-click functionality?

By default, middle-click will open a link in a new tab. Some sites end up breaking this functionality. Middle-click ends up being the same as left-click. Why does this happen? Is it because they program functionality for a click event, and…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
15
votes
2 answers

Move Mouse to Position and Left Click

I'm working on an Windows Form Application in C#, Framework 4 (32 bit). I have a list that holds coords of the mouse, and I can capture them. So far so good. But at some point, I want to go to those coords and left mouse click on it. This is how it…
Mathlight
  • 6,436
  • 17
  • 62
  • 107
1
2 3
42 43