#NEWLINE# def post_dispatch_input( self , etype , me ) : #NEWLINE# #INDENT# "This function is called by dispatch_input() when we want to dispatch\n        an input event. The event is dispatched to all listeners and if\n        grabbed, it's dispatched to grabbed widgets.\n        " #NEWLINE# if ( etype == 'begin' ) : #NEWLINE# #INDENT# self . me_list . append ( me ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( etype == 'end' ) : #NEWLINE# #INDENT# if ( me in self . me_list ) : #NEWLINE# #INDENT# self . me_list . remove ( me ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not me . grab_exclusive_class ) : #NEWLINE# #INDENT# for listener in self . event_listeners : #NEWLINE# #INDENT# listener . dispatch ( 'on_motion' , etype , me ) #NEWLINE# #UNINDENT# #UNINDENT# me . grab_state = True #NEWLINE# for _wid in me . grab_list [ : ] : #NEWLINE# #INDENT# wid = _wid ( ) #NEWLINE# if ( wid is None ) : #NEWLINE# #INDENT# me . grab_list . remove ( _wid ) #NEWLINE# continue #NEWLINE# #UNINDENT# root_window = wid . get_root_window ( ) #NEWLINE# if ( ( wid != root_window ) and ( root_window is not None ) ) : #NEWLINE# #INDENT# me . push ( ) #NEWLINE# ( w , h ) = root_window . system_size #NEWLINE# if ( ( platform == 'ios' ) or ( root_window . _density != 1 ) ) : #NEWLINE# #INDENT# ( w , h ) = root_window . size #NEWLINE# #UNINDENT# kheight = root_window . keyboard_height #NEWLINE# smode = root_window . softinput_mode #NEWLINE# me . scale_for_screen ( w , h , rotation = root_window . rotation , smode = smode , kheight = kheight ) #NEWLINE# parent = wid . parent #NEWLINE# try : #NEWLINE# #INDENT# if parent : #NEWLINE# #INDENT# me . apply_transform_2d ( parent . to_widget ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# me . apply_transform_2d ( wid . to_widget ) #NEWLINE# me . apply_transform_2d ( wid . to_parent ) #NEWLINE# #UNINDENT# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# me . pop ( ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# me . grab_current = wid #NEWLINE# wid . _context . push ( ) #NEWLINE# if ( etype == 'begin' ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( etype == 'update' ) : #NEWLINE# #INDENT# if wid . _context . sandbox : #NEWLINE# #INDENT# with wid . _context . sandbox : #NEWLINE# #INDENT# wid . dispatch ( 'on_touch_move' , me ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# wid . dispatch ( 'on_touch_move' , me ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( etype == 'end' ) : #NEWLINE# #INDENT# if wid . _context . sandbox : #NEWLINE# #INDENT# with wid . _context . sandbox : #NEWLINE# #INDENT# wid . dispatch ( 'on_touch_up' , me ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# wid . dispatch ( 'on_touch_up' , me ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# wid . _context . pop ( ) #NEWLINE# me . grab_current = None #NEWLINE# if ( ( wid != root_window ) and ( root_window is not None ) ) : #NEWLINE# #INDENT# me . pop ( ) #NEWLINE# #UNINDENT# #UNINDENT# me . grab_state = False