@@ -218,6 +218,10 @@ class Event:
218
218
type - type of the event as a number
219
219
widget - widget in which the event occurred
220
220
delta - delta of wheel movement (MouseWheel)
221
+ detail - certain fixed strings (see tcl/tk documentation)
222
+ (Enter, Leave, FocusIn, FocusOut, ConfigureRequest)
223
+ user_data - data string which was passed to event_generate or empty string
224
+ (VirtualEvent)
221
225
"""
222
226
def __repr__ (self ):
223
227
attrs = {k : v for k , v in self .__dict__ .items () if v != '??' }
@@ -1378,7 +1382,7 @@ def _root(self):
1378
1382
w = self
1379
1383
while w .master : w = w .master
1380
1384
return w
1381
- _subst_format = ('%#' , '%b' , '%f' , '%h' , '%k' ,
1385
+ _subst_format = ('%#' , '%b' , '%d' , '% f' , '%h' , '%k' ,
1382
1386
'%s' , '%t' , '%w' , '%x' , '%y' ,
1383
1387
'%A' , '%E' , '%K' , '%N' , '%W' , '%T' , '%X' , '%Y' , '%D' )
1384
1388
_subst_format_str = " " .join (_subst_format )
@@ -1395,11 +1399,14 @@ def getint_event(s):
1395
1399
except (ValueError , TclError ):
1396
1400
return s
1397
1401
1398
- nsign , b , f , h , k , s , t , w , x , y , A , E , K , N , W , T , X , Y , D = args
1399
- # Missing: (a, c, d, m, o, v, B, R)
1402
+ nsign , b , d , f , h , k , s , t , w , x , y , A , E , K , N , W , T , X , Y , D = args
1403
+ # Missing: (a, c, m, o, v, B, R)
1400
1404
e = Event ()
1401
1405
# serial field: valid for all events
1402
1406
# number of button: ButtonPress and ButtonRelease events only
1407
+ # detail: for Enter, Leave, FocusIn, FocusOut and ConfigureRequest
1408
+ # events certain fixed strings (see tcl/tk documentation)
1409
+ # user_data: data string from a virtual event or an empty string
1403
1410
# height field: Configure, ConfigureRequest, Create,
1404
1411
# ResizeRequest, and Expose events only
1405
1412
# keycode field: KeyPress and KeyRelease events only
@@ -1413,6 +1420,8 @@ def getint_event(s):
1413
1420
# KeyRelease, and Motion events
1414
1421
e .serial = getint (nsign )
1415
1422
e .num = getint_event (b )
1423
+ e .user_data = d
1424
+ e .detail = d
1416
1425
try : e .focus = getboolean (f )
1417
1426
except TclError : pass
1418
1427
e .height = getint_event (h )
0 commit comments