How to bind Ctrl+/ in python tkinter?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: works but doesn't. I am unable to bind ctrl + / in python. Is there any documentation of all the possible keys? 回答1: Use : def quit ( event ): print "you pressed control-forwardslash" root . quit () root = tk . Tk () root . bind ( ' ' , quit ) # forward-slash # root.bind(' ', quit) # backslash root . mainloop () I don't have a link to a complete list of these event names. Here is a partial list I've collected: | event | name | | Ctrl - c | Control - c | | Ctrl -/ | Control - slash | | Ctrl - \ | Control - backslash | | Ctrl +(