How to get Tkinter Mac-friendly menu shortcuts (cmd+key) How to get Tkinter Mac-friendly menu shortcuts (cmd+key) tkinter tkinter

How to get Tkinter Mac-friendly menu shortcuts (cmd+key)


I think you would need to specify one of the Meta and M Modifiers listed at Tk Built-in Commands -- perhaps Mod1 instead of Control. You might also find this list of keysyms recognized by Tk useful.

Although I've never actually every tried to do it -- if all else fails -- you might be able to determine what you need to know by writing your own event handler function def handlerName(event):, bind it to '<Any-KeyPress>' events, and then, in the function print the values of the attributes of the event argument being passed it when it's called -- such as event.keycode, event.keysym, event.keysym_num, etc -- thereby allowing you to see what to use for detecting ⌘-key modified keystrokes on your Mac.

Lastly, Python is open-source, so you can always try reading that.

Update: From the code in this answer it sounds like the Command- would work.