[issue27294] Better repr for Tkinter event objects

Terry J. Reedy report at bugs.python.org
Sat Jun 11 17:00:51 EDT 2016


Terry J. Reedy added the comment:

Right.  This is why I suggested leaving anything we are not sure of to a later patch, after gaining more experience (and thought).

However, 'state' behaved strangely in my experiments.  In a sequence of about 900 events, it started as 8 (Left Alt according to Shipman, but I never touched the key) and changed to 0 here

<Leave event state=8 focus=False x=120 y=-19 x_root=966 y_root=321>
<Enter event state=8 focus=False x=797 y=482 x_root=1861 y_root=940>
<ButtonPress event state=8 num=1 x=797 y=482 x_root=1861 y_root=940>
<Motion event state=264 x=797 y=483 x_root=1861 y_root=941>
<VirtualEvent event state=0 x=0 y=0 x_root=0 y_root=0>

back to 8 here

<VirtualEvent event state=0 x=0 y=0 x_root=0 y_root=0>
<ButtonRelease event state=264 num=1 x=800 y=489 x_root=1864 y_root=947>
<Leave event state=8 focus=False x=800 y=489 x_root=1864 y_root=947>

and briefly back to 0 here

<ButtonPress event state=8 num=1 x=178 y=134 x_root=1293 y_root=631>
<VirtualEvent event state=0 x=0 y=0 x_root=0 y_root=0>
<ButtonRelease event state=264 num=1 x=178 y=134 x_root=1293 y_root=631>
<Motion event state=8 x=179 y=134 x_root=1294 y_root=631>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27294>
_______________________________________


More information about the Python-bugs-list mailing list