Python Forum
Python catch mouse click in pure text, no graphics
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python catch mouse click in pure text, no graphics
#5
Yes, pynput seems to be a simple mouse event-catcher.
I tested it out in a very simple program:
from pynput import mouse

def on_click(x, y, button, pressed):
    print(button, pressed, listener)

listener = mouse.Listener(on_click=on_click)
listener.start()
I will need more advice to understand how to embed the mouse click event inside my while loop.
While the loop normally runs continuously, I need the option to hold the loop by its run conditions and advance one round per mouse click.
Reply


Messages In This Thread
RE: Python catch mouse click in pure text, no graphics - by samtal - Sep-06-2018, 06:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Regex to catch what user has put in text box robertkwild 26 5,893 Jun-26-2024, 01:06 PM
Last Post: AdamHensley
  mouse move event/cinfiguration ttk/python janeik 4 3,599 Jul-03-2023, 05:30 PM
Last Post: deanhystad
  Non repetitive mouse click Sartre 5 3,481 Apr-22-2023, 06:46 PM
Last Post: deanhystad
  try catch not working? korenron 2 1,695 Jan-15-2023, 01:54 PM
Last Post: korenron
  how to mouse click a specific item in pygame? Frankduc 5 3,084 May-03-2022, 06:22 PM
Last Post: Frankduc
  Multiprocessing queue catch get timeout Pythocodras 1 4,757 Apr-22-2022, 06:01 PM
Last Post: Pythocodras
  help with python mouse script z4rxxxx 0 1,694 Jan-15-2022, 04:39 PM
Last Post: z4rxxxx
  twisted: catch return from sql wardancer84 0 1,990 Sep-08-2021, 12:38 PM
Last Post: wardancer84
  Python graphics kaltenherz 1 2,403 Sep-05-2021, 05:19 PM
Last Post: jefsummers
  how to catch schema error? maiya 0 2,707 Jul-16-2021, 08:37 AM
Last Post: maiya

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020