Questions tagged [mouseevent]

A general tag for user-interface events that are generated by the mouse. This includes pressing/releasing a button, clicking (including double/triple-clicks), moving, dragging, etc.

This tag deals with the events that are generated by preforming actions with a Computer Mouse and similar input devices which emulate the behaviour of a mouse (such as Touchpads and Graphic Tablets).

Mouse events are usually split into several categories:

  • Button Press (Button Down) event - The event where a previously unpressed mouse button just became pressed
  • Button Release (Button Release) event - The event where a previously pressed mouse button just became unpressed
  • Button Click event - A Button Press event followed by a Button Release event. In some platforms and locations, this concept has one or more of the following limitations:
    • The Press and Release both happend while the mouse was in the same place (the mouse wasn't moved between the press and the release). Sometimes there is a lighter version of this restriction, which only forces the mouse to be above the same "user interface element" on the press and release events.
    • The Press and Release both happend inside a limited (usually short) time interval.
  • Button Double (Triple/...) Click event - Two (Three/...) click events, one after another with the same mouse button. These may also have one or more of the limitations mentioned for a single click event
  • Button Move (Motion) event - An event where the mouse is moved. Usually this refers only to the case where none of the mouse buttons was pressed (for the case where one or more buttons was in fact pressed, see the next definition).
  • Button Drag event - An event where the mouse moves while one or more of the mouse buttons is held down
  • Button (Scroll) Wheel event - In modern mice, there is usually a wheel part called scroll-wheel, which can be moved (aka rolled, scrolled) up and down. Such a movement of that part is referred to as a Mouse Wheel event.
    • In some newer alternative input devices which also serve as a mouse, sometimes there won't be any physical whell. Instead, there may be hot-spot areas and/or buttons that will emulate the movement of the wheel. For example, in many touchpads, a movement in certain areas will be interpreted as scroll event.
    • Some mice (and other devices) allow scrolling not just up and down, but also in other directions (typically, left and right).

For more information and definitions, see the Computer Mouse and it's operation on Wikipedia.

6218 questions
2
votes
1 answer

Java ball object doesn't bounce off of drawn rectangles like it's supposed to.

Sorry for the awful title. The purpose of the Java applet is as such: A ball is bouncing around the screen. The size and speed of this ball can be changed via scrollbars. The user can press and drag the mouse on the screen to draw rectangles. …
Alex Kibler
  • 4,674
  • 9
  • 44
  • 74
2
votes
3 answers

Raise event several times while Mouse held down

Basically let's say I'm making a simple counter, when I click the mouse, the counter goes up. My question is how do I program an even that makes it possible for me to have the counter flowing while the mouse I held down, basically something that…
ab1428x
  • 794
  • 2
  • 8
  • 20
2
votes
1 answer

How can I create a drag and draw event in jquery or javascript?

I want to anotate images using the following jquery plugin http://flipbit.co.uk/jquery-image-annotation.html but I want the user to drag and draw an anotation instead of clicking on ok button so how can i achieve this? any ideas?
irohit786
  • 135
  • 3
  • 15
2
votes
2 answers

Simulating mouse events and keyboard events c++ linux

I need to simulate some mouse events and keyboard events for my project and having trouble finding much information about the same. I tried out the original X11 code for simulating mouse which I got from the stackoverflow post, it seems to work fine…
Abhinav Macha
  • 58
  • 1
  • 9
2
votes
1 answer

Efficient method for finding object in map based on coordinates

I am building an editor using C++/Qt which has a click-and-drag feel to it. The behavour is similar to schematic editors (Eagle, KiCAD, etc), Microsoft Visio, or other programs where you drag objects from a toolbar into a central editing area. My…
Los Frijoles
  • 4,771
  • 5
  • 30
  • 49
2
votes
2 answers

SDL mouse button not consistent

I'm having a curious little problem polling mouse events using SDL. if(event.type == SDL_MOUSEBUTTONDOWN) { printf("click %d\n", event.button.button); } else if(event.type == SDL_MOUSEMOTION) { …
user1483596
  • 309
  • 2
  • 12
2
votes
1 answer

Drawing a rectangle on press and release of mouse, opengl

I'm trying to draw a rectangle from user input that collects x1,y1 coordinates from left click, and then specifies x2,y2 from release of the left click. I save the coordinates based on this mouse action successfully (based on cout<< statements…
Nibirue
  • 411
  • 1
  • 15
  • 29
2
votes
1 answer

Applescript - get the coordinates of an element

I need to get the coordinates {X,Y} of an element in order to generate a click event on it (I can't do that by using "click" since System Events has problem doing that and returns: "missing value"). I'll use these coordinates to pass them to a…
Giorgio
  • 1,603
  • 5
  • 29
  • 52
2
votes
1 answer

Keyboard, mouse event notification to vc++ application

I want to write application in vc++, that listens for keyboard , mouse events , even when my vc++ application running in background i.e it must get the notification about events even if its focus gets lost, and ** I don't want to use any third…
2
votes
0 answers

Cannot successfully add item to beginning of CategoryAxis series for a JavaFX BarChart

I've attempted to implement drag-left and drag-right functionality for a JavaFX BarChart. The drag-left functionality works correct where I add an item at the end of the x-axis data series and remove an item at the beginning. However, the drag-right…
rudolfv
  • 797
  • 1
  • 9
  • 22
2
votes
2 answers

Distinguish between leaving shape and entering overlapping shape (KineticJS)

I imagine this would be a pretty common issue I am having. I have one small shape on top of a larger shape. When I enter the large shape, it gets registered as a mouseenter/mouseover. But when I enter the small shape, the large shape registers a …
puk
  • 16,318
  • 29
  • 119
  • 199
2
votes
1 answer

How do I trigger a mouseenter (or any mouse) event on list items within a div with a z-index?

Every time I click on the list items only the z-index layer gets the mouse event. CSS has no trouble detecting the mouse hovering over the list item but I need jquery to display an image after retrieving the background-image from the list item's…
kmy
  • 21
  • 3
2
votes
2 answers

Get the delta value from PointeWheelChanged event for WinRT

Is there any way to get the delta value from PointeWheelChanged event in WinRT?
Jawahar
  • 4,775
  • 1
  • 24
  • 47
2
votes
2 answers

How can I access a variable from inside an anonymous mouse-event function?

I'm trying to access the variable myvar from outside like so: $(document).mousemove(function(e){ var myvar = winHeight() + scrollY() - e.pageY; }); console.log(myvar); But Chrome's javascript console keeps saying "Uncaught ReferenceError:…
Mo Ramzan
  • 23
  • 4
2
votes
1 answer

Why would MouseEvent.getButton() return NO_BUTTON?

I have code similar to the following: JComponent component = ... component.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { final int button = e.getButton(); System.out.println("button…
Steve McLeod
  • 51,737
  • 47
  • 128
  • 184
1 2 3
99
100