Hi, On Tue, 14 May 2019 13:53:54 +0000 Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote:
> Thanks all for your replies. > I've saw that there is a difference in the event.state, but I cannot > find any information on what each bit represents. > I modified your leave() callback using the values given at: https://infohost.nmt.edu/tcc/help/pubs/tkinter/web/event-handlers.html into: def leave(event): s = event.state b1 = (s & 0x0100) != 0 if b1: print('leave event with Button 1 pressed', 'event.state:', s) else: print('regular leave event', 'event.state:', s) which actually seems to do the trick (btw., same behavior here with xfce, so the exact Tk version apparently doesn't matter). However, there still seems to be no way to tell if it is an actual Leave event (i.e. mouse pointer dragged out of the window) while Button1 is pressed or one of those fake-Xfce-Leave events. The same "fake" events occur here also with Button2 and Button3, so there might be more event.state values to consider. Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. On my planet, to rest is to rest -- to cease using energy. To me, it is quite illogical to run up and down on green grass, using energy, instead of saving it. -- Spock, "Shore Leave", stardate 3025.2 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss