faqts : Computers : Programming : Languages : Python : Tkinter : Events

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 4 people (100%) answered Yes
Recently 3 of 3 people (100%) answered Yes

Entry

How can I get the state of the other mouse buttons in the callback for a button1 event?
How can I get the state of buttons and keys in an event instance?

Mar 1st, 2000 21:57
Nathan Wallace, Fredrik Lundh


The event instance has a "state" member which reflects the state of
modifier keys and mouse buttons.

iirc, the relevant bitmasks are:

    Button1Mask = 1<<8
    Button2Mask = 1<<9
    Button3Mask = 1<<10