是否可以禁用 Tkinter 中的左右箭头键?

Is it possible to disable the left and right arrow keys in Tkinter?

在 Tkinter 的列表框中,左右箭头键可用于滚动 listbox 中的内容,如果它超出框本身的大小。

我尝试使用 .bind() 功能重新绑定密钥,但是无论我用它做什么,滚动功能仍然存在。

我也尝试过使用 [the listbox].xview_moveto(0.0) 覆盖滚动条,但出于某种原因 0.0 在技术上并不是 listbox 的开始。

"break" 的 return 值将停止任何进一步的功能,因此您必须将其重新绑定到 returns "break".[=11= 的功能]

.bind("<Left>", lambda e: "break") # Disables the left arrow key