How to Get Mouse Coordinates (x, y) with Python

How to Get Mouse Coordinates (x, y) with Python

WebDevPro

3 года назад

24,461 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Hoang Chung Nguyen
Hoang Chung Nguyen - 25.08.2023 18:52

How to quit progame?

Ответить
Dtar380
Dtar380 - 05.07.2023 15:00

is there a way to make it just take the coordinate when we start it or its only doing it until we exit the program

Ответить
John D
John D - 05.04.2023 22:50

I keep getting an error that says "mouse.Listener" is not defined. Where do we do that

Ответить
Oliver Schlieper
Oliver Schlieper - 30.03.2023 21:46

from pynput import *

def get_coords (x, y):
print(x, y)

with mouse.Listener(on_move=get_coords) as listen:
listen.join()

Ответить
Fernando Rodriguez
Fernando Rodriguez - 25.02.2023 19:07

👍👏👏

Ответить
Samreen A
Samreen A - 27.01.2023 20:53

I DON'T WANT THE MOUSE MOVEMENT ON TERMINAL, I WANT THE MOVEMENTS TO BE STORED IN EXCEL, how can we do that...can u pls help me out

Ответить
Vishal Sardar
Vishal Sardar - 16.12.2022 15:42

how to stop this running program
I'm running this program in VS Code, and I've tried to stop program using ctrl+c.
but it won't work. any help appreciated
@WebDevPro

Ответить
alain boyadjian
alain boyadjian - 27.11.2022 17:05

How to get mouse position with defined frequency?

Ответить
Li Joso
Li Joso - 29.09.2022 16:26

Hey: how to solve this error:
def get_coords(x, y):
print("Now at: {}" .format((x, y)))

with mouse.Listener(on_move = get_coords) as listen:
listen.Join()
plt.show()

NameError Traceback (most recent call last)
<ipython-input-3-26b895c09808> in <module>
2 print("Now at: {}" .format((x, y)))
3
----> 4 with mouse.Listener(on_move = get_coords) as listen:
5 listen.Join()
6 plt.show()

NameError: name 'mouse' is not defined

Ответить
Enamul Haque
Enamul Haque - 10.09.2022 12:22

I want to store these coordinates points to a variable so that i can make a plot. Can you show how?

Ответить
John Doe
John Doe - 04.09.2022 10:04

thanks man, really helped

Ответить
Cedric
Cedric - 18.07.2022 08:38

how to stop?)

Ответить
Melone
Melone - 13.07.2022 20:22

Whenever i try do "pip install pynput" it just comes out with:
'pip' is not recognized as an internal or external command,
operable program or batch file.
Any way to fix this?

Ответить
Peter griffin
Peter griffin - 04.06.2022 14:14

Thank you! Good and straight forward tutorial. 👍

Ответить
Javier De Benavides
Javier De Benavides - 09.03.2022 14:02

Hi there! Do you know how could I save those coordinates into variables?

Ответить
LemonsAreJuicy
LemonsAreJuicy - 13.02.2022 05:42

what application are you using to write the code?

Ответить
Augustine
Augustine - 26.09.2021 21:46

thanks man, this worked perfectly for what i'm working on

Ответить