#NEWLINE# def on_key_press( self , symbol , modifiers ) : #NEWLINE# #INDENT# if ( symbol == pyglet . window . key . TAB ) : #NEWLINE# #INDENT# if ( modifiers & pyglet . window . key . MOD_SHIFT ) : #NEWLINE# #INDENT# direction = ( - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# direction = 1 #NEWLINE# #UNINDENT# self . set_next_focus ( direction ) #NEWLINE# return True #NEWLINE# #UNINDENT# if ( ( self . _focus is not None ) and hasattr ( modifiers . _focus , 'on_key_press' ) ) : #NEWLINE# #INDENT# return self . _focus . on_key_press ( symbol , modifiers )