#NEWLINE# def onKeyPress( self , sender , keycode , modifiers ) : #NEWLINE# #INDENT# if ( keycode == KeyboardListener . KEY_ESCAPE ) : #NEWLINE# #INDENT# self . input . setEnabled ( False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( keycode == KeyboardListener . KEY_ENTER ) : #NEWLINE# #INDENT# self . input . setEnabled ( False ) #NEWLINE# val = self . input . getText ( ) #NEWLINE# self . set_grid_value ( sender . row , self . col , val )