mouseevent

Drag and drop files to QListWidget created with QT-Designer

Drag and drop files to QListWidget created with QT-Designer Question: i am trying to implement a drag and drop feature to PyQt5 QListWidget it works if self.acceptDrops(True) is in the code but it works on whole application window and wherever i drag file in the window it will add a file to QListWidget… My goal …

Total answers: 1

tkinter canvas with mousewheel

tkinter canvas with mousewheel Question: I’m trying to make a canvas scrollable with a mousewheel. I tried this to see if I could at least print something with the action of the mousewheel: from tkinter import * from tkinter import ttk import platform class MainWindow: def __init__(self): self.metrics = [] self.content = ttk.Frame(root) self.content.grid_rowconfigure(0, weight …

Total answers: 1

selecting mutliple items in python Tkinter Treeview with mouse event Button-1

selecting mutliple items in python Tkinter Treeview with mouse event Button-1 Question: I looked for and tested many similar questions/answers/possible duplicates here on SO and other sites but I’m interested specifically in using the solution below for simplicity’s sake and minimal reproducible example constraint satisfaction. Why does the following modification of this previous answer’s code …

Total answers: 2

Create a QGraphicsItem at the mouse double-click position

Create a QGraphicsItem at the mouse double-click position Question: I’m writing a program that should create a QGraphicsItem when a double-click happens (inside the scene area), and also that item must be created at double-click position. I’ve already written some code, but it doesn’t work properly. When I double-click on the scene, an item gets …

Total answers: 1

how to triple-click on python to select a paragraph?

how to triple-click on python to select a paragraph? Question: Someone please tell me a way to triple-click on selenium python. I tried this and other things but it did not work. for x in range(3) actions.click() Asked By: Moises Park || Source Answers: I would say that you are missing the perform action: from …

Total answers: 5

I am trying to move my camera in minecraft with python

I am trying to move my camera in minecraft with python Question: I have successfully found out how to move, drag, and click in Minecraft with python code. The only thing is that I have gotten the cursor to work in the inventory/crafting menu. One line I used to go up was pyautogui.moveRel(0, -33, duration=0.1) …

Total answers: 3

How to detect if mouse was clicked?

How to detect if mouse was clicked? Question: I’m trying to build a short script in Python, where if the mouse is clicked, the mouse will reset to some arbitrary position (right now the middle of the screen). I’d like this to run in the background, so it could work with other applications (most likely …

Total answers: 5

Capture mouse position outside QMainWindow (without click)

Capture mouse position outside QMainWindow (without click) Question: I tried: self.installEventFilter(self) and: desktop= QApplication.desktop() desktop.installEventFilter(self) With: def eventFilter(self, source, event): if event.type() == QEvent.MouseMove: print(event.pos()) return QMainWindow.eventFilter(self, source, event) In QMainWindow object but nothing conclusive. Do you have any idea? Asked By: Mauricio || Source Answers: Mouse events are initially handled by the window-manager, which …

Total answers: 1

Store mouse click event coordinates with matplotlib

Store mouse click event coordinates with matplotlib Question: I am trying to implement a simple mouse click event in matplotlib. I wish to plot a figure then use the mouse to select the lower and upper limits for integration. So far I am able to print the coordinates to screen but not store them for …

Total answers: 3