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.
6,008
questions
0
votes
2
answers
14
views
How do you detect if the cursor is directly above text using javascript?
I want to change an element when the cursor is only directly above some text.
For instance :
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et ...
0
votes
3
answers
34
views
How do you get computed cursor type in javascript?
I want to change an element when the cursor changes its type, for instance when the cursor changes from pointer to a text (I-beam).
I have tried to use
document.addEventListener('mouseover', e => {
...
0
votes
1
answer
31
views
Click event triggered on element but failing to toggle the visibility of the section containing it
I need to toggle a section (called "newHexagon")'s visibility by alternatively clicking two different h2's, "seeHexagon" and "hideHexagon". The former is external, the ...
-3
votes
0
answers
42
views
How do I detect if a mouse button (LMB, RMB, MMB) is pressed in C# on .NET 6.0 [closed]
How do I detect if a mouse button (left, right, middle) is down in C# using .NET 6.0? I have tried System.Windows.Input and System.Windows.Forms, but neither works for me.
0
votes
0
answers
15
views
Is it possible to select texts with mouse in the case of horizontally allocated QTextEdit?
There are three QGraphicsView in one line. If these QGraphicsView is vertically located (orientation is 0), to select texts with mouse is no problem. But if these QGrahpicsView is horizontally located,...
2
votes
1
answer
26
views
pygame detecting if drawn circle sprite is clicked failing
I am working on a small game where if you click a circle it makes a pop sound and goes back to the bottom my problem is when I switched to using a class and sprite to allow multiple circles it no ...
-4
votes
0
answers
35
views
i'm stupid, don't know how to code, and want someone to write code for a cursor [closed]
i am an idiot who barely knows how programming works.
today i would like to ask someone for someone to please help me by writing code for a specific effect in a specific area of the cursor to happen.
...
0
votes
1
answer
25
views
How do I add a marker where I click (React/Nextjs google maps api)
I'm trying to make it so that when I click on the map, I can place a marker on the location of the mouse click. (deleting the previous marker) Here is my code:
const guessCoords = null;
const ...
0
votes
1
answer
20
views
What is the appropriate type of event for MouseEvent<HTMLDivElement> in Typescript?
What I'm trying to do is to close modal when clicking outside div element.
Please check my code first.
// onClose function is setState(false) function.
import { useRef, useEffect } from 'hooks'
...
1
vote
2
answers
47
views
How can I call the mouse right click event in SwingGui?
I have a table. If I right-click I got a JPopUpMenu but before the pop-up I want to select the row where the right-click event is done. Here is what I've tried.
path_tbl.addMouseListener(new ...
0
votes
0
answers
25
views
how to get mouse to click specific(s)
I'm trying to write a code to control where the mouse clicks. currently, I have the code to press Win + X.
I am trying to figure out what would need to be done in order to have the mouse clicks work ...
0
votes
0
answers
9
views
Will mousemove fire before mouseup?
The spec says that mousemove event fires at specific framerate that depends on envorinment.
But as I have tested it also always fires right before every mouseup, with the same coordinates. So lets say ...
3
votes
3
answers
170
views
React onMouseEnter and onMouseLeave bug, not working consistently
I am having issues with React onMouseEnter and onMouseLeave, sometimes the events are not firing when it should
I am using onMouseEnter and onMouseLeave to show/hide a React Portal Modal tooltip panel:...
0
votes
2
answers
33
views
hide button onmouseenter isn't triggering
My onmouseenter function isn't triggering.
I created a button that would allow you to go to the top. However, once there I want the button to have a display property of none. I tried doing it in two ...
0
votes
1
answer
27
views
How do I make a div click without the mouse moving?
I'm trying to make a JavaScript code that injects into cpstest.org and when you click the start button, it automatically starts auto-clicking. I tried to make a script for it, but it just didn't work.
...
0
votes
2
answers
34
views
Typing RxJs fromEvent's parameter as a MouseEvent yields error
I'm trying to listen to a user's mouse click on a DOM element, and to fetch the event's clientX/clientY mouse coordinates. Using angular v12.1.5 and RxJs v6.6.0.
const click$ = () =>
fromEvent(...
0
votes
0
answers
12
views
map leaflet - imageOverlay - mouse event
I use leaflet in order to view images like this:
function addPictures() {
vm.imageUrl1 = 'https://media.istockphoto.com/photos/wooden-hanging-rope-bridge-over-mountain-river-picture-...
0
votes
0
answers
16
views
How to force onWheel (SyntheticEvent, React) to be in an active mode?
WheelEvents are by default passive. Hence, event.preventDefault is not working. In my React project, I do want to prevent the default behavior, though.
When using event listeners, this can be solved ...
0
votes
1
answer
9
views
Issues with moving a GObject in Java
I have a rectangular GObject I want to follow my mouse across a screen. It is currently leaving a black line if moved across since the program does not remove any of the previous rectangles. The code ...
0
votes
0
answers
21
views
How to get iframe access using multiple random iframe using puppeteer scripts headless browser
I have done many tries to get access to the below DOM element using puppeteer scripts but I have not found it yet. Also during the cursor hover event cursor is disabled to hover that element.
I have ...
0
votes
1
answer
18
views
Mouse click event on a simple list: keep the style on, and all others turn off
I'm using a list to filter a number of other elements. Basically, I need help with making it show visually which one is the most recently selected item,
Current Status: My current mouseover, mouseout ...
0
votes
0
answers
21
views
How to check values in Dynamic Text Editor got changed or not?
I have a text editor that is created in runtime-dynamically with dynamic id's.
Before close the window , I am trying to check whether anything changed in that editor or not.
I tried with different ...
0
votes
0
answers
13
views
PyQt - strange behaviour of mousePressEvent in QWebEngineView [duplicate]
I notice a difference in the behavior between a QWebEngineView and a, for example, QLabel when implementing mouse events. I don't understand why.
The event should be captured by the widget where is ...
-1
votes
0
answers
9
views
Can you detect a real mouse from an faker?
Let's say I have an standard computer mouse with RGB lights. It is connected via a bi-directional USB. It will click and move for me when I direct it to. I also have a teensy RGB arduino box. I have a ...
0
votes
1
answer
28
views
How to use mouseleave event to close Bootstrap-Vue Tooltip
I have a custom color Vue 2 picker component created using a combination of bootstrap-vue button and tooltip components like so:
<template>
<div>
<b-button
ref=&...
0
votes
0
answers
23
views
Is it possible to generate mouse actions and keystrokes (similar to SendKeys) in Google Apps Script?
I'm trying to write a code in Google Apps Script similar to something I do in VBA.
I need to manage a webpage (write some text, click some buttons) but I can't find any thread or text with Keystrokes ...
0
votes
0
answers
11
views
Mouse press not registering
When I click the JFrame it should register the click and output system.out.println but it isn't i'm fairly sure the mouselistener isn't on the jframe but I don't know how to add it. I've tried messing ...
1
vote
0
answers
27
views
jQuery .click() event not being captured
I was trying to make a play-pause button using jQuery but the mouse click event is not being captured. I am trying to remove and add font-awesome class on each click such that it can change its icon.
&...
0
votes
1
answer
67
views
Simulating mouse click using python and win32api
I am trying to simulate a mouse left click on a window (Samsung Flow) but unfortunately it is not working. When I try on a google chrome window it works, but I have tried on Paint and on Samsung Flow ...
-1
votes
2
answers
23
views
Any other mouse buttons pressed suppress MouseButtons.Left [C#]
Whenever you hold any other mouse button when the program is working it suppresses the work of it.
Etc. Holding right mouse button stops clicking.
bool mousdown = MouseButtons == MouseButtons.Left;
...
0
votes
0
answers
20
views
How to make reposition/move IFrame element with mouse drag?
I would like to reposition the iframe element on a website through mouse drag.
Dynamically Created IFrame Element
// create div to hold iframe
let iframeContainer = document.createElement(&...
0
votes
0
answers
17
views
Handsontable enable mouse events for select2
How to enable mouse event for select2 dropdown embeded in handsontable pressent it works only on keyboard event only.
1
vote
0
answers
30
views
How to distinguish between mouse click and touchpad tap events in Tkinter?
I have an application running on a Windows PC having both touchscreen and mouse.
On this application there are some Entry widgets and I would need a virtual keyboard appearing when tapping on them, ...
0
votes
1
answer
25
views
Disabling dragndrop from baseweb DnD list
I actually have a drag and drop list from BaseWeb https://baseweb.design/components/dnd-list/,
And instead of havings strings as the exemple shows, i'm having components for a blog, like a text ...
1
vote
1
answer
57
views
Qt - Draw on opencv-imshow with mouse after capture from UI doesn't work
I have this Qt Project where I can capture an Image from WebCam and afterwards draw on it using OpenCV MouseCallbacks (I perform the drawing on the imshow, not the QGraphicsView).
I can capture the ...
0
votes
0
answers
55
views
`cv2.waitKey` raises "cv2.error: Unknown C++ exception from OpenCV code"
Let's say I have this code:
import cv2
import numpy as np
img = np.zeros((1080, 1920, 3), np.uint8)
def click_event(event, x, y, flags, params):
global myx, myy
if event == cv2....
0
votes
0
answers
10
views
Performant way of getting mouse position every frame for canvas animation in React?
I have an animated background using canvas and requestAnimationFrame in my React app and I am trying to have its moving particles interact with the mouse pointer, but every solution I try ranges from ...
-1
votes
1
answer
31
views
How to draw QRubberBand on a QGraphicsView using Mouse?
I have my MainWindow with a GraphicsView on which I want to draw a QRubberBand using MouseEvents. Therefore I created a custom GraphicsView class where I have the MouseEvents, however since I am a ...
1
vote
2
answers
37
views
override graphstream's DefaultMouseManager
I'm using GraphStream to show a map of an area and I've tried to inherit from the default MouseManager DefaultMouseManager and to override the mouseClicked method so that when clicking on a node the ...
0
votes
0
answers
30
views
How can we send touchpad events into webview page
I am trying to drag a canvas on an webpage created with qooxdoo. (EA CnCTA Game).
Android webview can scroll fine. The webpage however isn't recieving mouse movement events. If the webpage canvas is ...
3
votes
0
answers
35
views
How to "capture" the event when node moves under the stand still mouse
We know that in JavaFX the MOUSE_MOVED event is fired when the cursor moves on an EventTarget. In this case, the node stands still and the cursor moves.
Now, consider this: We have a ScrollPane and ...
0
votes
0
answers
12
views
Get the relative position of the mouse when using `onmousemove` inside of the tag
Consider the code below. This code returns the absolute position of the mouse when hovering over the div tag.
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 200px;
...
0
votes
1
answer
23
views
bug of mouse event in the function mouseReleaseEvent() of PyQt5?
code first:
class MyWidget(QMainWindow)
def __init__(self):
super(MyWidget, self).__init__()
self.setMinimumSize(900, 500)
self.setMouseTracking(True)
def mousePressEvent(self, e):
if ...
1
vote
1
answer
37
views
Retrieving node/edge with mouse events
I'm following the official GraphStream tutorial, and as the title suggest - I'm trying to get node's by clicking on it.
this is my code so far:
import org.graphstream.graph.*;
import org.graphstream....
1
vote
0
answers
34
views
Use both mousedown and touchstart to change button content class and vice versa
I have a button containing a child component which consists of a circle made with a div. I want the circle to change color when the user clicks with a mouse or touches the screen. I tried this and it ...
0
votes
1
answer
52
views
Draw point on mouse click with Java Swing
I'm working on a project in which I am trying to draw point on mouse click within a JPanel with Java Swing.
I save each time the clicked points coordinate in currentX and currentY and create an ...
2
votes
1
answer
59
views
Angular: How can I prevent the scrollbar from moving when navigating with the arrow keys up and down?
I have developed a table and which I have integrated a self-created navigation. Problem is, when I scroll up and down so always moves the scrollbar with. Is there a way when I press keydown or keyup ...
0
votes
0
answers
10
views
Is there any way to detect if the website doesn't allow right mouse click given the website url?
I am building a project. I have a list of website URLs, and I want to know if the website allows the right mouse click or not. For example in this on clicking the right mouse, the website says that ...
0
votes
1
answer
30
views
How to get the xpath
How to get xpath on given page for Dresses Category (image with Dresses text)
https://www.amazon.com/b/ref=af_spr22_L1_w_nav_1?pf_rd_r=5FE3DS056G2PHQZPGCQV&pf_rd_p=e8199fbf-0485-4dda-aa8b-...
0
votes
1
answer
63
views
Html Javascript + Mouse click hold event
I have html and when the mouse is clicked and dragged, any intersecting boxes will be highlighted blue. On mouse up, the selection highlight disappears.
.root {
align-items: center;
...