#
#
# .2020-05-28 14:16:50
Python
# ., 2020-05-28 14:16:50

How to track mouse clicks?

It is necessary to make it so that when the mouse is pressed, X action is performed. It doesn't matter to me what libraries there will be and how big the code is. It would be nice to show an example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FT BK, 2020-06-04
@FTBK

You can use tkinter:

import tkinter as tki # можно и from tkinter import *

root = tki.Tk() # создаём окно, при нажатии на которое будут выводиться данные о событии

def printPressedButton(event):
    print(event) # выводим в консоль  событие (что и где нажато), здесь должна быть табуляция

root.bind('<ButtonPress>', printPressedButton) # ButtonPress - реакция на нажатие 
# можно , конечно, и Button, и ButtonRelease и др.
root.mainloop() # Запускаем главный цикл...

this is one of the options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question