在 Tkinter 中是否有等同于 get_focus() 的 <"Enter">?

Is there an equivalent to get_focus() in Tkinter for <"Enter">?

在 Tkinter 中,对于事件 <"FocusIn">(您可以将其绑定到一个小部件),您喜欢“反转”函数 .get_focus(),它将显示widget,此时有焦点。
对于事件 <"Enter">(这意味着鼠标光标悬停在某个小部件上)是否有等效的“反向”功能?类似于“.get_entered()”或类似的东西,向您显示鼠标光标悬停在其上的小部件的名称?

要找出光标下的小部件,您可以使用 winfo_containing 方法。

x, y = root.winfo_pointerxy()
widget = root.winfo_containing(x,y)