如何知道鼠标左键是否被按下 [英] How to know if the left mouse click is pressed

查看:64
本文介绍了如何知道鼠标左键是否被按下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PyAutoGUI 库.如何知道鼠标左键是否被按下?

I am using PyAutoGUI library. How can I know if the left mouse button is pressed?

这就是我想要做的:

if(leftmousebuttonpressed):
   print("left")
else:
   print("nothing")

推荐答案

(我是 PyAutoGUI 的作者.)我可以确认当前 PyAutoGUI 无法读取/记录点击或击键.这些功能在路线图上,但目前没有专门用于它们的资源或时间表.

(I'm the author of PyAutoGUI.) I can confirm that currently PyAutoGUI can't read/record clicks or keystrokes. These features are on the roadmap, but there aren't any resources or timelines dedicated to them currently.

这篇关于如何知道鼠标左键是否被按下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆