简体   繁体   中英

Binding “§” key to button in Python

I try to bind key § to a function:

top.bind("§", lambda x: startRecognition(v, label2, top))

However, this binding with key § is not working. It is an actual key on Mac keyboard by the way.

Other keys on the keyboard are working with this code, so it is clearly a problem either with the key "§" itself or the symbol '§'. Anyone knows?

I'm using Sublime text editor by the way

Apparently, the appropriate binding for the section sign key (§) is <section> :

top.bind("<section>", lambda x: startRecognition(v, label2, top))

To discover it, we bound <Key> (any key), then noted the event.keysym from events that involved that key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM