Index: Lib/lib-tk/Tkinter.py =================================================================== --- Lib/lib-tk/Tkinter.py (revision 65077) +++ Lib/lib-tk/Tkinter.py (working copy) @@ -1111,7 +1111,7 @@ w = self while w.master: w = w.master return w - _subst_format = ('%#', '%b', '%f', '%h', '%k', + _subst_format = ('%#', '%b', '%d', '%f', '%h', '%k', '%s', '%t', '%w', '%x', '%y', '%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D') _subst_format_str = " ".join(_subst_format) @@ -1128,11 +1128,12 @@ except ValueError: return s - nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args - # Missing: (a, c, d, m, o, v, B, R) + nsign, b, d, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args + # Missing: (a, c, m, o, v, B, R) e = Event() # serial field: valid vor all events # number of button: ButtonPress and ButtonRelease events only + # data: data is valid for all virtual events # height field: Configure, ConfigureRequest, Create, # ResizeRequest, and Expose events only # keycode field: KeyPress and KeyRelease events only @@ -1146,6 +1147,15 @@ # KeyRelease,and Motion events e.serial = getint(nsign) e.num = getint_event(b) + + if d: + try: + e.data = self.nametowidget(d) + except KeyError: + # value passed to the data option is not a widget, take it + # as the detail field + e.data = None + e.detail = d try: e.focus = getboolean(f) except TclError: pass e.height = getint_event(h)