Python Documentation and/or Lack Thereof (e.g. keyboard event.state) [closed] Python Documentation and/or Lack Thereof (e.g. keyboard event.state) [closed] tkinter tkinter

Python Documentation and/or Lack Thereof (e.g. keyboard event.state) [closed]


tkinter is a wrapper around Tk. If you have questions about Tk, the best source I know is https://www.tcl.tk/doc/.

If you look at http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/event-handlers.html I think you'll see how to do what you want to. As to where this is documented, I believe that John Shipman, the author of the this post, got a lot of his information from the tkinter source code by using some automated documentation tool. He told me how he did it in an email, but it was a number of years ago, and I've forgotten the details.

On my Mac (with a Logitech Windows keyboard) I get a mask of 0x10 for both left and right Alt, though the values for Shift and Ctrl match. So it does seem to be platform-dependent to some extent. I also get non-zero masks when I press an arrow key, a function key, or a numeric keypad key.