Questions tagged [mousedown]

Mousedown is a browser event that occurs when a user clicks the mouse button down on an element.

Mousedown is a browser event that occurs when a user clicks the mouse button down on an element. It usually occurs right before a mouseup event (when the user releases the mouse), and is part of an onclick event, which comprises both the click down and release of the mouse.

416 questions
8
votes
2 answers

MouseDown doesnt work in Grid (only on buttons which in grids)

I have problem with MouseDown event. My app looks like that, I have grid in which im adding buttons in code behind
user13657
  • 745
  • 3
  • 17
  • 36
7
votes
3 answers

how to prevent focus event in IE when mousedown happens

event.preventDefault(); return false; event.stopPropagation(); any of them can prevent focus event from happening when I trigger a mousedown event in Firefox and chrome, but it failed in IE.In fact,chrome has another problem. when mousedowning,…
Jinceon
  • 1,292
  • 2
  • 13
  • 21
7
votes
2 answers

Unity global mouse events

Most Unity tutorials suggest using Mouse events within the Update function, like this: function Update () { if (UnityEngine.Input.GetMouseButton(1)) { } } This strikes me as really inefficient though, similar to using onEnterFrame in AS…
zoosrc
  • 515
  • 3
  • 6
  • 12
6
votes
2 answers

Does NotifyIcon have a MouseDown equivalent?

I have a NotifyIcon in the system tray. How can I detect when the user has left-clicked down on it? I assumed the MouseDown event would be what I want to use but it only handles right click and middle-button click. For left-click, it only fires…
Skoder
  • 3,983
  • 11
  • 46
  • 73
6
votes
2 answers

JS: detect right click without jQuery (inline)

I'm calling a function, that builds a table which includes several links. I want to check if a link has been clicked with right or left mouse. I tried to add the following part to the hyperlink. onmousedown="function mouseDown(e){ switch…
Keith L.
  • 2,084
  • 11
  • 41
  • 64
6
votes
1 answer

hover style can not apply when press mouse button in chrome

All: [UPDATE] I find another way to implement this, not solution, but just a working trick: Use mousedown as a event trigger(because I need a drag action, so there should be a mousedown event anyway), inside that, bind mouseover event to that span(I…
Kuan
  • 11,149
  • 23
  • 93
  • 201
6
votes
1 answer

AddEventListener: onmousedown

I am creating a Chrome Extension which checks to see if there is "onmousedown" attribute and if so I will execute some code. I have tried this however it isn't working. document.addEventListener("onmousedown", function() { });
6
votes
1 answer

make delayed mousedown event

I have a datagridview which cells has a click event. The cells also have the following mouseDown event: if (e.Button == MouseButtons.Left && e.Clicks == 1) { string[] filesToDrag = { "c:/install.log" }; …
Kristian
  • 1,348
  • 4
  • 16
  • 39
6
votes
3 answers

How to know the current state of mouse button(mouseup state or mousedown state)

In Javascript, when I click on a scrollbar (Any scrollbar that appears in the page) and hover over the image, the image again start to drag. Image should only be drag on mousebutton down state. So I tried to tackle this problem by knowing the mouse…
vusan
  • 5,221
  • 4
  • 46
  • 81
6
votes
3 answers

jQuery event to stop on mouseup

I am trying to make a very simple application where the user can draw into a table with a selected color when the mouse button is down, and the event stops when the mouse is up. The drawing works well, the only problem is that the event doesn't stop…
Zoltan
  • 163
  • 2
  • 12
5
votes
3 answers

GoogleMaps loses mouseUp event if rectangle redrawn in mouseMove event

The following code sample has me baffled. It's the simplest version of a larger piece of code that I can use to demonstrate my problem. Basically I want the user to be able to draw a bounding box by holding down the mouse key and dragging it. If…
5
votes
1 answer

Why is my cursor turning into a block icon on mousedown?

I'm currently doing the etch-a-sketch project from the Odin Project and running into an issue where my cursor will sometimes turn into a block icon when I click and drag my mouse over my drawing grid. I currently have a variable isPainting that acts…
5
votes
1 answer

Safari Only CSS Hover Event Not Triggered on Drag

There seems to be something wrong with Safari registering the hover event with css. If you run the snippet below and drag the cursor from blue to green, two things should happen. On all browsers, the green div will turn red on hover. On non-Safari…
Gregory Ling
  • 185
  • 15
5
votes
1 answer

mousedown and mouseup triggered on touch devices

Just curious about the purpose of mousedown and mouseup events since they are triggered also on touch devices. I thought that mousedown and touchstart are mutually exclusive (the former working on desktop while the latter on touch devices) and the…
revy
  • 3,945
  • 7
  • 40
  • 85
5
votes
1 answer

Handle 'mouseleave' while 'mousedown'

I created a custom button with a div that has a unique border style. I'm trying to handle 'mousedown' to toggle border colours to give the illusion of indent. Then handle 'mouseup' to toggle back to default. The issue is when the mouse leaves the…
Lightfooted
  • 799
  • 1
  • 6
  • 13
1
2
3
27 28