'''
事件(鼠标):
<Button-1>:鼠标左键,<Button-2>:鼠标中间键,<Button>:鼠标右键
<B1-Motion>:鼠标左键并移动鼠标,类似的<B2-Motion>、<B3-Motion>分别是按鼠标中间键和右键并移动鼠标
<ButtonRelease-1>:释放鼠标左键.<ButtonRelease-2>、<ButtonRelease-3>
<Double-Button-1>:两次双击鼠标.<Double-Button-2>、<Double-Button-3>
<Enter>:鼠标进入构件
<Leave>: 鼠标离开构件
事件(键盘):
<Return>:键盘输入Enter键.BackSpace, Tab, Shift_L,Control_L, Alt_L , Pause, Caps_Lock, Escape, Prior (Page Up), Next (Page Down), End, Home, Left, Up, Right, Down, Print, Insert, Delete, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Num_Lock, croll_Lock以及键盘上的其余各键.
'''
'''
事件属性:
x,y:当前鼠标位置(像素为单位)
x_root,y_root:当前鼠标相对于左上角屏幕的位置(像素为单位)
keysym:键入字符
keycoe:键的代码
type:事件类型
'''
from tkinter import *
class
python-tkinter-事件与映射
最新推荐文章于 2024-06-17 07:15:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)