Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我今天的问题是,我想知道,是否有一种方法可以检测未使用 canvas.bind() 按下的鼠标按钮。我想知道这一点,因为我想在按下按钮时保存数据,并在不再按下按钮时停止保存数据。我想用鼠标左键 / ''
如果你不知道我不想做什么;随时在评论中提问:/
检测鼠标按下和释放事件。当这些事件之一发生时,根据需要开始或停止保存。
canvas.bind("<Button-1>", start_saving) canvas.bind("<ButtonRelease-1>", stop_saving)